aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@gentoo.org>2008-05-31 16:40:47 -0400
committerMike Frysinger <vapier@gentoo.org>2008-05-31 17:08:16 -0400
commitcaf5fa0d623573c6510656a5da392675ee3f802e (patch)
tree793361bf523bb47e23b3a1558151217f7de4721f
parentrpm2targz: make tempfile handling secure (diff)
downloadrpm2targz-caf5fa0d623573c6510656a5da392675ee3f802e.tar.gz
rpm2targz-caf5fa0d623573c6510656a5da392675ee3f802e.tar.bz2
rpm2targz-caf5fa0d623573c6510656a5da392675ee3f802e.zip
rpm2targz: use more portable code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xrpm2targz6
1 files changed, 3 insertions, 3 deletions
diff --git a/rpm2targz b/rpm2targz
index 018d21c..8bfb52c 100755
--- a/rpm2targz
+++ b/rpm2targz
@@ -58,7 +58,7 @@ for i in $* ; do
# Determine if this is a source or binary RPM.
# If we have getrpmtype, use that. Otherwise, try "file".
- if which getrpmtype 1> /dev/null 2> /dev/null; then
+ if command -v getrpmtype 1> /dev/null 2> /dev/null; then
if getrpmtype -n $i | grep source 1> /dev/null 2> /dev/null ; then
isSource=1
else
@@ -73,7 +73,7 @@ for i in $* ; do
fi
ofn=${WORKDIR}/`basename $i .rpm`.cpio
- if $USERPM2CPIO && which rpm2cpio 1> /dev/null 2> /dev/null ; then
+ if $USERPM2CPIO && command -v rpm2cpio 1> /dev/null 2> /dev/null ; then
rpm2cpio $i > $ofn 2> /dev/null
if [ ! $? = 0 ]; then
echo "... rpm2cpio failed. (maybe $i is not an RPM?)"
@@ -113,7 +113,7 @@ for i in $* ; do
fi
mkdir -p $DEST
( cd $DEST
- cpio --extract --preserve-modification-time --make-directories < $ofn 1> /dev/null 2> /dev/null
+ cpio -i -m -d < $ofn 1> /dev/null 2> /dev/null
rm -f $ofn
find . -type d -perm 700 -exec chmod 755 {} \; )
( cd ${WORKDIR} ; tar cf - . ) > `basename $i .rpm`.tar