diff options
author | 2009-11-06 07:34:41 -0500 | |
---|---|---|
committer | 2009-11-06 08:04:49 -0500 | |
commit | d136d0f3c8643cc92ab226de3a18e650730fa847 (patch) | |
tree | db345343252aa02f06e582a234c1284734a70033 | |
parent | ignore gdb/patch files (diff) | |
download | rpm2targz-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-- | Makefile | 1 | ||||
-rwxr-xr-x | rpm2targz | 20 |
2 files changed, 15 insertions, 6 deletions
@@ -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 @@ -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 |