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:57:53
Branch: rpm-5_4 Handle: 2015040212575200
Modified files: (Branch: rpm-5_4)
rpm/scripts trpm
Log:
trpm: 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:
RevisionChanges Path
1.12.20.3 +15 -15 rpm/scripts/trpm
patch -p0 '@@ .'
Index: rpm/scripts/trpm
$ cvs diff -u -r1.12.20.2 -r1.12.20.3 trpm
--- rpm/scripts/trpm 25 Jan 2011 15:16:31 - 1.12.20.2
+++ rpm/scripts/trpm 2 Apr 2015 12:57:52 - 1.12.20.3
@@ -14,9 +14,9 @@
rpmdb=$rpm
rpmk=$rpm
-pgppubkey=`echo /usr/share/doc/rpm-4*/RPM-PGP-KEY`
-gpgpubkey=`echo /usr/share/doc/rpm-4*/RPM-GPG-KEY`
-betapubkey=`echo /usr/share/doc/rpm-4*/BETA-GPG-KEY`
+pgppubkey=$(echo /usr/share/doc/rpm-4*/RPM-PGP-KEY)
+gpgpubkey=$(echo /usr/share/doc/rpm-4*/RPM-GPG-KEY)
+betapubkey=$(echo /usr/share/doc/rpm-4*/BETA-GPG-KEY)
#rpm=/X/src/rpm402/rpm
#rpmb=/X/src/rpm402/rpmb
@@ -30,9 +30,9 @@
dist=8.0
type=min
-arch=`$rpm --eval '%{_arch}' | sed -e 's/i686/i386/'`
+arch=$($rpm --eval '%{_arch}' | sed -e 's/i686/i386/')
-top=`pwd`
+top=$(pwd)
root=$top/$dist
sudo=sudo
justdb=--justdb --noscripts --notriggers --ignoresize
@@ -230,10 +230,10 @@
[ $# -eq 0 ] break
shift
echo args: $*
-echo === start $cmd`date`
+echo === start $cmd$(date)
case $cmd in
debug) dbg=echo;;
-dmalloc) eval `dmalloc -b $dmopts` ;;
+dmalloc) eval $(dmalloc -b $dmopts) ;;
db1) db1=--define '%_dbapi 1' ;;
5.2|6.2|7.*|8.*)
dist=$cmd
@@ -266,15 +266,15 @@
ls -1 ${pkgs}/*.rpm | egrep (noarch|$arch).rpm list-$dist-$arch
cat list-$dist-$arch | egrep -v $notallpat all-$dist-$arch
$dbg $rpmq $rc -qp --qf /$dist/SRPMS/%{sourcerpm}\\n \
-`cat all-$dist-$arch` | sort | uniq all-$dist-$arch-srpms
+$(cat all-$dist-$arch) | sort | uniq all-$dist-$arch-srpms
for l in $classes ; do
glv='$'${l}glob
- glist=`eval echo $glv`
+ glist=$(eval echo $glv)
for g in $glist ; do
ls -1 ${pkgs}/${g}*.rpm 2 /dev/null
done | egrep (noarch|$arch).rpm $sorted $l-$dist-$arch
$dbg $rpmq $rc -qp --qf /$dist/SRPMS/%{sourcerpm}\\n \
-`cat $l-$dist-$arch` | sort | uniq $l-$dist-$arch-srpms
+$(cat $l-$dist-$arch) | sort | uniq $l-$dist-$arch-srpms
done
;;
clean)
@@ -282,7 +282,7 @@
$dbg $sudo mv $root ${root}-$$ $dbg $sudo rm -rf ${root}-$$
;;
--rebuild)
- for srpm in `cat $type-$dist-$arch-srpms` ; do
+ for srpm in $(cat $type-$dist-$arch-srpms) ; do
$dbg $rpmb $rc $cmd $srpm
done
;;
@@ -292,7 +292,7 @@
$dbg $sudo touch $root/etc/fstab
$dbg $sudo touch $root/etc/mtab
$dbg $sudo $rpmdb $rc --root $root --initdb
- if [ X`$rpm --version` = XRPM version 4.2 ]; then
+ if [ X$($rpm --version) = XRPM version 4.2 ]; then
$dbg $sudo $rpmk $rc --root $root --import $pgppubkey
$dbg $sudo $rpmk $rc --root $root --import $gpgpubkey
$dbg $sudo $rpmk $rc --root $root --import $betapubkey
@@ -309,14 +309,14 @@
echo $type-$dist-$arch not found
exit 1
}
- $dbg $sudo $rpmi $rc --root $root -Uv $justdb `cat $type-$dist-$arch`
+ $dbg $sudo $rpmi $rc --root $root -Uv $justdb $(cat $type-$dist-$arch)
;;
-U*|-F*)
[ -f $type-$dist-$arch ] || {
echo $type-$dist-$arch not found
exit 1