RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 02-Apr-2015 14:57:27 Branch: rpm-5_4 Handle: 2015040212572600 Modified files: (Branch: rpm-5_4) rpm/scripts javadeps.sh Log: javadeps.sh: 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.3.4.1 +4 -4 rpm/scripts/javadeps.sh ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/scripts/javadeps.sh ============================================================================ $ cvs diff -u -r1.3 -r1.3.4.1 javadeps.sh --- rpm/scripts/javadeps.sh 9 Dec 2009 15:00:27 -0000 1.3 +++ rpm/scripts/javadeps.sh 2 Apr 2015 12:57:26 -0000 1.3.4.1 @@ -16,13 +16,13 @@ JCFDUMP=${1:-jcf-dump} JAR=${2:-jar} -dump=`mktemp ${TMPDIR:-/tmp}/classdepXXXXXX` +dump=$(mktemp ${TMPDIR:-/tmp}/classdepXXXXXX) if test -z "$dump"; then echo Error creating temporary file. exit 1 fi -classdir=`mktemp -d ${TMPDIR:-/tmp}/classdepXXXXXX` +classdir=$(mktemp -d ${TMPDIR:-/tmp}/classdepXXXXXX) if test -z "$classdir"; then echo Error creating temporary directory. rm -f $dump @@ -80,7 +80,7 @@ ;; *.jar) if ! $JAR tf "$filename" | grep -q -e '(^..|^/|^\\)' ; then - PUSHDIR=`pwd` + PUSHDIR=$(pwd) cd $classdir > /dev/null $JAR xf "$filename" cd $PUSHDIR > /dev/null @@ -101,7 +101,7 @@ ;; *.jar) if ! $JAR tf "$filename" | grep -q -e '(^..|^/|^\\)' ; then - PUSHDIR=`pwd` + PUSHDIR=$(pwd) cd $classdir > /dev/null $JAR xf "$filename" cd $PUSHDIR > /dev/null @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
