diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-11-29 21:39:02 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-11-29 21:39:02 +0000 |
commit | 1280a34c6c6eacaef3b7505c6d2e58f3212d742e (patch) | |
tree | e9e09f6d93fc8e16b2fd13844b07beede33176d8 /scripts/unrpm | |
parent | 44cd42dacb2db43a0275454e747ac054f15b7f74 (diff) | |
download | busybox-w32-1280a34c6c6eacaef3b7505c6d2e58f3212d742e.tar.gz busybox-w32-1280a34c6c6eacaef3b7505c6d2e58f3212d742e.tar.bz2 busybox-w32-1280a34c6c6eacaef3b7505c6d2e58f3212d742e.zip |
Finish commit of rpmunpack and add in scripts for undeb and unrpm
git-svn-id: svn://busybox.net/trunk/busybox@1344 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'scripts/unrpm')
-rw-r--r-- | scripts/unrpm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/unrpm b/scripts/unrpm new file mode 100644 index 000000000..2cd1aa9c9 --- /dev/null +++ b/scripts/unrpm | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | usage() { | ||
4 | echo "Usage: unrpm -l package.rpm <List contents of rpm package>" | ||
5 | echo " unrpm -x package.rpm /foo/boo <Extract rpm package to this directory," | ||
6 | echo " put . for current directory>" | ||
7 | exit | ||
8 | } | ||
9 | |||
10 | rpm=$2 | ||
11 | |||
12 | exist() { | ||
13 | if [ "$rpm" = "" ]; then | ||
14 | usage | ||
15 | elif [ ! -s "$rpm" ]; then | ||
16 | echo "Can't find $rpm!" | ||
17 | exit | ||
18 | fi | ||
19 | } | ||
20 | |||
21 | if [ "$1" = "" ]; then | ||
22 | usage | ||
23 | elif [ "$1" = "-l" ]; then | ||
24 | exist | ||
25 | type more >/dev/null 2>&1 && pager=more | ||
26 | type less >/dev/null 2>&1 && pager=less | ||
27 | (echo -e "\nPress enter to scroll, q to Quit!\n" ; rpmunpack < $rpm | gunzip -c | cpio -tvf --quiet) | $pager | ||
28 | exit | ||
29 | elif [ "$1" = "-x" ]; then | ||
30 | exist | ||
31 | if [ "$3" = "" ]; then | ||
32 | usage | ||
33 | elif [ ! -d "$3" ]; then | ||
34 | echo "No such directory $3!" | ||
35 | exit | ||
36 | fi | ||
37 | rpmunpack < $rpm | gunzip | (cd $3 ; cpio -idmuv) || exit | ||
38 | echo | ||
39 | echo "Extracted $rpm to $3!" | ||
40 | exit | ||
41 | else | ||
42 | usage | ||
43 | fi | ||