summaryrefslogtreecommitdiff
path: root/scripts/ipkg-unbuild
Side-by-side diff
Diffstat (limited to 'scripts/ipkg-unbuild') (more/less context) (show whitespace changes)
-rwxr-xr-xscripts/ipkg-unbuild29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/ipkg-unbuild b/scripts/ipkg-unbuild
new file mode 100755
index 0000000..f724f75
--- a/dev/null
+++ b/scripts/ipkg-unbuild
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+if [ $# -lt 1 ]; then
+ echo "usage: $0: package.ipk"
+ exit 1
+fi
+
+while [ $# -gt 0 ]; do
+ filename=$1
+ shift
+
+ pkg=`echo $filename | sed 's/.*\///;s/.ipk$//;s/.deb$//'`
+
+ mkdir -p $pkg
+ mkdir -p $pkg/CONTROL
+
+ pkg_dir=$PWD
+ cd $pkg; (ar x ../$filename || tar zxf ../$filename) >& /dev/null
+ cd $pkg_dir
+
+ tar xzf $pkg/data.tar.gz -C $pkg
+ tar xzf $pkg/control.tar.gz -C $pkg/CONTROL
+ rm -f $pkg/control.tar.gz $pkg/data.tar.gz $pkg/debian-binary
+done
+
+
+