This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 21144 - rpm-3.0.6_IBM_patch_002 popt/configure sed fix to remove POTFILES last backslash
rpm-3.0.6_IBM_patch_002 popt/configure sed fix to remove POTFILES last backslash
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: popt (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-20 17:17 EST by Paul Shearer
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-20 17:19:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
rpm-3.0.6_IBM_patch_002.txt Patch file (3.65 KB, patch)
2000-11-20 17:19 EST, Paul Shearer
no flags Details | Diff

  None (edit)
Description Paul Shearer 2000-11-20 17:17:11 EST
IBM SPTS:     254361

IBM PATCH:   rpm-3.0.6_IBM_patch_002

Submitter:      paulsh@us.ibm.com
                     Paul Shearer

Product:         Red Hat Linux
Version:         6.2
Component:    rpm-3.0.6
Platform:        All | i386
OS:               All
uname -a:      DYNIX/ptx eng2 4.0 V4.6.0 i386

Summary:

        popt/configure sed script does not remove backslash from last line

Description:

OVERVIEW DESCRIPTION:

        popt/configure sed script needs to also remove backslash from last line.
        Upgrade the sed script to match the one in popt/po/Makefile.in

STEPS TO REPRODUCE:

        This works:
        cd popt/po
        make POTFILES

        The make target uses the correct sed script:

        (sed -e '/^#/d' -e '/^[  ]*$$/d' \
                    -e "s@.*@   $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
                | sed -e '$$s/\\$$//') > $@-t


        This does not work with popt/configure which uses the incorrect sed:

         sed -e "/^#/d" -e "/^\$/d" -e "s,.*,       $posrcprefix& \\\\," -e
         "\$s/\(.
         *\) \\\\/\1/" \
                 < $srcdir/po/POTFILES.in > po/POTFILES

        cd popt
        ./configure
        cd popt/po
        make
        Make: line 91: syntax error.  Stop.

        Because the popt/configure does not use the correct sed script
        like the one in popt/po/Makefile.in.  (see patch below)

        This popt/configure sed is wrong since the last sed command is
        applied to the last line (blank line in POTFILES)
        which has been deleted by earlier sed commands.
        So it may depend on what sed you use,
        but the sed man page documents that each sed command
        "applies in sequence all commands whose addresses
        select that pattern space" so this may vary with your sed.

        Thus the popt/configure does not remove the last backslash from
        the last nonblank line from POTFILES.

        This causes the make error when $(POTFILES) is expanded.

        Simple fix is to remove the last blank line from POTFILES.in
        and make sure the last line is nonblank, i.e. a filename.

        Complete fix is to replace the incorrect sed in the popt/configure
        with the correct one used in popt/po/Makefile.in.
        The patch below does that.

ACTUAL RESULTS:

        This does not work:
        cd popt
        ./configure

        cd popt/po
        make
        Make: line 91: syntax error.  Stop.

        The error is due to $(POTFILES) expanding with a \ on the last line
        due to the incorrect sed script in popt/configure


EXPECTED RESULTS:

        The expected results is to correctly produce the popt/po/Makefile
        assignment POTFILES without a backslash on the last line.

POTFILES = \
        ../findme.c \
        ../popt.c \
        ../poptconfig.c \
        ../popthelp.c \
        ../poptparse.c \
        ../test1.c

        The patch below fixes popt/configure to produce the above result.

BUILD DATE & PLATFORM:

        svr4 sed

ADDITIONAL BUILDS AND PLATFORMS:

        N/A

ADDITIONAL INFORMATION: (crash info)

        N/A

UNIX STACK TRACE:

        N/A

SAMPLE PATCH:

IBM patch sequence number: rpm-3.0.6_IBM_patch_002


List of files patched followed by RCS or SCCS ident lines.
==========================================================

popt/configure



Patch to fix the files
======================
*** 1.1 2000/11/02 09:33:16
--- popt/configure      2000/11/15 20:07:21
***************
*** 4226,4232 ****
       posrcprefix="../"
     fi
     rm -f po/POTFILES
!    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,       $posrcprefix& \\\\," -e "\$s/\(.
*\) \\\\/\1/" \
        < $srcdir/po/POTFILES.in > po/POTFILES


--- 4226,4233 ----
       posrcprefix="../"
     fi
     rm -f po/POTFILES
!    (sed -e "/^#/d" -e "/^[    ]*\$/d"  -e "s,.*,      $posrcprefix& \\\\," |
!     sed -e "\$s/\(.*\) \\\\/\1/" ) \
        < $srcdir/po/POTFILES.in > po/POTFILES
Comment 1 Paul Shearer 2000-11-20 17:19:48 EST
Created attachment 5582 [details]
rpm-3.0.6_IBM_patch_002.txt Patch file
Comment 2 Jeff Johnson 2001-08-24 13:20:31 EDT
This bug will be addresed after rpm-4.0.3 is released.

Note You need to log in before you can comment on or make changes to this bug.