aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rpm2targz')
-rwxr-xr-xrpm2targz20
1 files changed, 14 insertions, 6 deletions
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