diff options
-rwxr-xr-x | rpm2targz | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |