summaryrefslogtreecommitdiff
path: root/unrpm
diff options
context:
space:
mode:
authorDr. Peter Poeml <poeml@cmdline.net>2007-01-26 04:21:48 +0000
committerDr. Peter Poeml <poeml@cmdline.net>2007-01-26 04:21:48 +0000
commitc072da291bf94686944e48885abd371f079e004a (patch)
treee725d6698d4cd5e81ef77351a64fcd7dd9ea0e30 /unrpm
parentb1dc5c98420c5e52b394898a883311adc4e24801 (diff)
downloadbuild-c072da291bf94686944e48885abd371f079e004a.tar.gz
build-c072da291bf94686944e48885abd371f079e004a.tar.bz2
build-c072da291bf94686944e48885abd371f079e004a.zip
re-add the lost unrpm script
Diffstat (limited to 'unrpm')
-rwxr-xr-xunrpm41
1 files changed, 41 insertions, 0 deletions
diff --git a/unrpm b/unrpm
new file mode 100755
index 0000000..90e8d69
--- /dev/null
+++ b/unrpm
@@ -0,0 +1,41 @@
+#! /bin/bash
+#
+
+function Usage () {
+ echo "Usage: $(basename $0) [-v] rpm-files...";
+ echo "Unpack rpm files in current directory.";
+ exit 1
+}
+
+CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories"
+
+FILES=""
+VERBOSE=false
+QUIET=false
+
+for i in $* ; do
+ case "$i" in
+ -v)
+ VERBOSE=true
+ ;;
+ -q)
+ QUIET=true
+ ;;
+ *)
+ FILES="$FILES $i"
+ ;;
+ esac
+done
+
+
+test "$VERBOSE" = "true" && CPIO_OPTS="$CPIO_OPTS --verbose"
+test "$QUIET" = "true" && CPIO_OPTS="$CPIO_OPTS --quiet"
+
+test -z "$FILES" && Usage
+
+for f in $FILES; do
+ if test "$QUIET" = "false" ; then
+ echo -ne "$f:\t"
+ fi
+ rpm2cpio $f | cpio ${CPIO_OPTS}
+done