RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm-5_4: rpm/scripts/ vpkg-provides2.sh

From: devzero2000 <pinto.elia@gmail.com>
Date: Thu 02 Apr 2015 - 18:11:19 CEST
Message-ID: <CAH5b-BW1zsq50fTOaf-6b-rgv=CRtDy3yiWnKUUYuwnZAAOShA@mail.gmail.com>
Il 02/Apr/2015 17:39 "Jeffrey Johnson" <n3npq@me.com> ha scritto:
>
> Um ... was there actually a problem being solved here?
>
> Some of these scripts (like rpm2cpio.sh) are vitally
> important and have been posted publicly like here
>
http://stackoverflow.com/questions/18787375/how-do-i-extract-the-contents-of-an-rpm/25986787#25986787
> and integrated into other projects. The syntax change is
> highly intrusive to using diff to see what has changed.
>
> *shrug* Many of these scripts haven't been used in years.

Ciao jbj

The aim is to modernize a little these shells. The comment should be clear.
The change  is trivial, but a further check is certainly necessary ( some
incompatibility is possible ) .

Thanks

>
> But please state your intent before aesthetically driven changes like
this.
>
> 73 de Jeff
>
> On Apr 2, 2015, at 8:57 AM, Pinto Elia wrote:
>
> >  RPM Package Manager, CVS Repository
> >  http://rpm5.org/cvs/
> >
____________________________________________________________________________
> >
> >  Server: rpm5.org                         Name:   Pinto Elia
> >  Root:   /v/rpm/cvs                       Email:  devzero2000@rpm5.org
> >  Module: rpm                              Date:   02-Apr-2015 14:57:58
> >  Branch: rpm-5_4                          Handle: 2015040212575800
> >
> >  Modified files:           (Branch: rpm-5_4)
> >    rpm/scripts             vpkg-provides2.sh
> >
> >  Log:
> >    vpkg-provides2.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.22.1    +8  -8      rpm/scripts/vpkg-provides2.sh
> >
____________________________________________________________________________
> >
> >  patch -p0 <<'@@ .'
> >  Index: rpm/scripts/vpkg-provides2.sh
> >
============================================================================
> >  $ cvs diff -u -r1.3 -r1.3.22.1 vpkg-provides2.sh
> >  --- rpm/scripts/vpkg-provides2.sh    15 Mar 2001 13:58:16 -0000
1.3
> >  +++ rpm/scripts/vpkg-provides2.sh    2 Apr 2015 12:57:58 -0000
 1.3.22.1
> >  @@ -11,9 +11,9 @@
> >
> >   IGNORE_DIRS='@'
> >
> >  -date=`date`
> >  -hostname=`uname -n`
> >  -osname=`uname -s`
> >  +date=$(date)
> >  +hostname=$(uname -n)
> >  +osname=$(uname -s)
> >
> >   # programs we run
> >
> >  @@ -29,16 +29,16 @@
> >   requires_tmp=/tmp/requires.$$
> >
> >
> >  -for pkg in `$u_pkg list_all_packages`
> >  +for pkg in $($u_pkg list_all_packages)
> >   do
> >
> >   # find OS pkg information
> >
> >   spec_filename=$spec_filedir/$pkg
> >
> >  -veryify_cmd=`$u_pkg print_cmd package_version $pkg | sed -e
"s/\\$1/$pkg/" `
> >  +veryify_cmd=$($u_pkg print_cmd package_version $pkg | sed -e
"s/\\$1/$pkg/" )
> >
> >  -pkg_version=`$u_pkg package_version $pkg `
> >  +pkg_version=$($u_pkg package_version $pkg )
> >
> >
> >   # find all the dependencies
> >  @@ -74,7 +74,7 @@
> >
> >   %description
> >   This is a virtual RPM package.  It contains no actual files.  It uses
the
> >  -\`Provides' token from RPM 3.x and later to list many of the shared
libraries
> >  +\$(Provides' token from RPM 3.x and later to list many of the shared
libraries
> >   and interpreters that are part of the base operating system and
associated
> >   subsets for $osname.
> >
> >  @@ -103,7 +103,7 @@
> >   export PATH
> >
> >   expected_version='$pkg_version'
> >  -current_version=\`$veryify_cmd\`
> >  +current_version=\)$veryify_cmd\`
> >
> >   if [ \$expected_version -ne \$current_version ]; then
> >       echo "RPM virtual package does not match OS pkg: $pkg" >&2
> >  @@ .
> > ______________________________________________________________________
> > RPM Package Manager                                    http://rpm5.org
> > CVS Sources Repository                                rpm-cvs@rpm5.org
>
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> Developer Communication List                        rpm-devel@rpm5.org
Received on Thu Apr 2 18:11:20 2015
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.