diff options
author | 2008-05-31 16:40:47 -0400 | |
---|---|---|
committer | 2008-05-31 17:08:16 -0400 | |
commit | caf5fa0d623573c6510656a5da392675ee3f802e (patch) | |
tree | 793361bf523bb47e23b3a1558151217f7de4721f /rpm2targz | |
parent | rpm2targz: make tempfile handling secure (diff) | |
download | rpm2targz-caf5fa0d623573c6510656a5da392675ee3f802e.tar.gz rpm2targz-caf5fa0d623573c6510656a5da392675ee3f802e.tar.bz2 rpm2targz-caf5fa0d623573c6510656a5da392675ee3f802e.zip |
rpm2targz: use more portable code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'rpm2targz')
-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 |