aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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