aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-11-06 07:34:41 -0500
committerMike Frysinger <vapier@gentoo.org>2009-11-06 08:04:49 -0500
commitd136d0f3c8643cc92ab226de3a18e650730fa847 (patch)
treedb345343252aa02f06e582a234c1284734a70033
parentignore gdb/patch files (diff)
downloadrpm2targz-d136d0f3c8643cc92ab226de3a18e650730fa847.tar.gz
rpm2targz-d136d0f3c8643cc92ab226de3a18e650730fa847.tar.bz2
rpm2targz-d136d0f3c8643cc92ab226de3a18e650730fa847.zip
rpmunpack: new shortcut for quicker unpacking
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--Makefile1
-rwxr-xr-xrpm2targz20
2 files changed, 15 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 20314bb..f051455 100644
--- a/Makefile
+++ b/Makefile
@@ -33,5 +33,6 @@ install: rpmoffset
for t in tar tarbz2 tbz2 tarlzma tgz ; do \
$(dosym) rpm2targz $(DESTDIR)$(bindir)/rpm2$$t ; \
done
+ $(dosym) rpm2targz $(DESTDIR)$(bindir)/rpmunpack
.PHONY: all clean install
diff --git a/rpm2targz b/rpm2targz
index b09b4dc..43444dd 100755
--- a/rpm2targz
+++ b/rpm2targz
@@ -64,6 +64,7 @@ fi
compress="cat"
case ${argv0} in
+ rpmunpack) suffix="";;
rpm2tar) suffix=".tar";;
rpm2tarbz2) compress="bzip2" suffix=".tar.bz2";;
rpm2tbz2) compress="bzip2" suffix=".tbz2";;
@@ -157,10 +158,8 @@ for file; do
)
if [ $? -ne 0 ] ; then
- ret=1
-
- ${verbose} && echo "FAIL"
- else
+ false
+ elif [ -n "${suffix}" ] ; then
# repack the files into the appropriate tar file
(
cd "${WORKDIR}"
@@ -172,9 +171,18 @@ for file; do
cat > "${outfile}${suffix}"
fi
)
-
- ${verbose} && echo "OK"
+ else
+ # just unpacking, so move the files
+ cp -pPR "${DEST}/" ./
+ fi
+ tret=$?
+ if [ ${tret} -eq 0 ] ; then
+ msg=OK
+ else
+ ret=${tret}
+ msg=FAIL
fi
+ ${verbose} && echo ${msg}
rm -rf "${DEST}"
done