-rwxr-xr-x | scripts/ipkg-unbuild | 29 |
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | if [ $# -lt 1 ]; then | ||
6 | echo "usage: $0: package.ipk" | ||
7 | exit 1 | ||
8 | fi | ||
9 | |||
10 | while [ $# -gt 0 ]; do | ||
11 | filename=$1 | ||
12 | shift | ||
13 | |||
14 | pkg=`echo $filename | sed 's/.*\///;s/.ipk$//;s/.deb$//'` | ||
15 | |||
16 | mkdir -p $pkg | ||
17 | mkdir -p $pkg/CONTROL | ||
18 | |||
19 | pkg_dir=$PWD | ||
20 | cd $pkg; (ar x ../$filename || tar zxf ../$filename) >& /dev/null | ||
21 | cd $pkg_dir | ||
22 | |||
23 | tar xzf $pkg/data.tar.gz -C $pkg | ||
24 | tar xzf $pkg/control.tar.gz -C $pkg/CONTROL | ||
25 | rm -f $pkg/control.tar.gz $pkg/data.tar.gz $pkg/debian-binary | ||
26 | done | ||
27 | |||
28 | |||
29 | |||