cpp-d1064d
[cross.git] / bin / unpack
diff --git a/bin/unpack b/bin/unpack
new file mode 100755 (executable)
index 0000000..0630995
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+usage="unpack SOURCE_DIR [TARGET_DIR]"
+
+if [ $# -lt 2 ]
+then
+       echo $usage
+       exit 1
+fi
+
+source_dir=$1
+target_dir=.
+if [ -n "$2" ]
+then
+       target_dir=$2
+fi
+
+for deb in $(ls $source_dir/*.deb)
+do
+       echo "extract $deb"
+       dpkg-deb -x $deb $target_dir
+done
+