aboutsummaryrefslogtreecommitdiff
path: root/scripts/unrpm
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-11-29 21:39:02 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-11-29 21:39:02 +0000
commit1280a34c6c6eacaef3b7505c6d2e58f3212d742e (patch)
treee9e09f6d93fc8e16b2fd13844b07beede33176d8 /scripts/unrpm
parent44cd42dacb2db43a0275454e747ac054f15b7f74 (diff)
downloadbusybox-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/unrpm43
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#
3usage() {
4echo "Usage: unrpm -l package.rpm <List contents of rpm package>"
5echo " unrpm -x package.rpm /foo/boo <Extract rpm package to this directory,"
6echo " put . for current directory>"
7exit
8}
9
10rpm=$2
11
12exist() {
13if [ "$rpm" = "" ]; then
14usage
15elif [ ! -s "$rpm" ]; then
16echo "Can't find $rpm!"
17exit
18fi
19}
20
21if [ "$1" = "" ]; then
22usage
23elif [ "$1" = "-l" ]; then
24exist
25type more >/dev/null 2>&1 && pager=more
26type 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
28exit
29elif [ "$1" = "-x" ]; then
30exist
31if [ "$3" = "" ]; then
32usage
33elif [ ! -d "$3" ]; then
34echo "No such directory $3!"
35exit
36fi
37rpmunpack < $rpm | gunzip | (cd $3 ; cpio -idmuv) || exit
38echo
39echo "Extracted $rpm to $3!"
40exit
41else
42usage
43fi