diff options
-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 |