RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: rpm Date: 02-Apr-2015 14:56:38 Branch: rpm-5_4 Handle: 2015040212563800 Modified files: (Branch: rpm-5_4) rpm/scripts brp-compress Log: brp-compress: use the $( ... \) construct for command substitution Prefer the $( ... ) construct for command substitution instead of using the back-quotes, or grave accents (`..`). The backquoted form is the historical method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. Because of this the POSIX shell adopted the $(â¦) feature from the Korn shell. The patch was generated by the simple script for _f in $(find . -type f -exec file {} \; | grep -i shell | awk -F: '{ print $1 }') do perl -i -pe 'BEGIN{undef $/;} s@`(.*)`@\$($1)@smg' ${_f} done Summary: Revision Changes Path 1.13.10.2 +10 -10 rpm/scripts/brp-compress ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/scripts/brp-compress ============================================================================ $ cvs diff -u -r1.13.10.1 -r1.13.10.2 brp-compress --- rpm/scripts/brp-compress 6 Sep 2011 12:53:10 -0000 1.13.10.1 +++ rpm/scripts/brp-compress 2 Apr 2015 12:56:38 -0000 1.13.10.2 @@ -17,21 +17,21 @@ ./usr/share/doc/*/man/man* ./usr/lib/*/man/man* do [ -d $d ] || continue - for f in `find $d -type f` + for f in $(find $d -type f) do [ -f "$f" ] || continue - [ "`basename $f`" = "dir" ] && continue + [ "$(basename $f)" = "dir" ] && continue case "$f" in - *.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.Z$//'`;; - *.gz) gunzip -f $f; b=`echo $f | sed -e 's/\.gz$//'`;; - *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;; + *.Z) gunzip -f $f; b=$(echo $f | sed -e 's/\.Z$//');; + *.gz) gunzip -f $f; b=$(echo $f | sed -e 's/\.gz$//');; + *.bz2) bunzip2 -f $f; b=$(echo $f | sed -e 's/\.bz2$//');; *) b=$f;; esac $COMPRESS $b </dev/null 2>/dev/null || { - inode=`ls -i $b | awk '{ print $1 }'` - others=`find $d -type f -inum $inode` + inode=$(ls -i $b | awk '{ print $1 }') + others=$(find $d -type f -inum $inode) if [ -n "$others" ]; then for afile in $others ; do [ "$afile" != "$b" ] && rm -f $afile @@ -46,11 +46,11 @@ } done - for f in `find $d -type l` + for f in $(find $d -type l) do - l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'` + l=$(ls -l $f | sed -e 's/.* -> //' -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//') rm -f $f - b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'` + b=$(echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//') ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT done done @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org