Bug 21170

Summary: rpm-3.0.6_IBM_patch_003 patch to allow overwrites of readonly stamp-h.in
Product: [Retired] Red Hat Linux Reporter: Paul Shearer <paulsh>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DEFERRED QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: low    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-21 10:30:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
rpm-3.0.6_IBM_patch_003.txt Patch file to patch configure.in Makefile.in popt/Makefile.in none

Description Paul Shearer 2000-11-21 10:26:34 UTC
IBM SPTS: 254456

IBM PATCH: rpm-3.0.6_IBM_patch_003

Submitter:  paulsh.com
                 Paul Shearer

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

Summary:

        rpm-3.0.6_IBM_patch_003 patch to allow overwrites of stamp-h.in

Description:

OVERVIEW DESCRIPTION:

        rpm-3.0.6/Makefile.in needs to rm stamp-h.in before creating it.
        This is because stamp-h.in may be writeable on the original src tar,
        however when it is checked into RCS or CVS, and then checked out,
        it is often initially readonly.
        Thus remove it before attempting to recreate it.

        @rm -f $(srcdir)/stamp-h.in
        @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null

        popt/Makefile has the same problem.
        (see patch below)

        HOWEVER, If the intention was to RETAIN the timestamp it it is
        readonly, and thus the logic dumping stderr to /dev/null,
        then at a minimum we need to use -@ instead of @ in front of the
        command in the Makfile.in so that the command returning error
        does not cause make to Stop.

        -@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null



        In this case you would also not want the patch to configure.in,
        but instead just let the command that updates stamp-h.in
        in both configure and config.status fail as it does now:

        ./config.status[788]: stamp-h.in: cannot create [Permission denied]

STEPS TO REPRODUCE:

        cd rpm-3.0.6
        chmod -w stamp-h.in     (May be readonly if checked out from cvs)
        ./configure ...
        make

ACTUAL RESULTS:

        (configure)
        ./config.status[788]: stamp-h.in: cannot create [Permission denied]
        ...

        (make)
        sh[1]: ./stamp-h.in: cannot create [Permission denied]
        *** Error code 1
        Make: .  Stop.

        (same occurs in popt/Makefile)

EXPECTED RESULTS:

        Assuming...
        We should be able to create new stamp-h.in if it is currently readonly.
        If this is not true, then I don't understand the use of stamp-h.in
        and possibly this patch should not be applied.

        Again if that is the case then the Makefile.in should be changed to:
        -@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null

        Code review is necessary.

BUILD DATE & PLATFORM:

        N/A

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_003


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

configure.in
Makefile.in
popt/Makefile.in



Patch to fix the files
======================
*** 1.2 2000/11/03 22:31:35
--- configure.in        2000/11/21 10:02:07
***************
*** 919,925 ****
        doc/Makefile doc/manual/Makefile
        doc/ja/Makefile doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile
        python/Makefile perl/Makefile perl/Makefile.PL],
!       [echo timestamp > popt/stamp-h.in
        echo timestamp > stamp-h.in])
  dnl   touch Makefile.in
  dnl   sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
--- 919,927 ----
        doc/Makefile doc/manual/Makefile
        doc/ja/Makefile doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile
        python/Makefile perl/Makefile perl/Makefile.PL],
!       [rm -f popt/stamp-h.in
!       echo timestamp > popt/stamp-h.in
!       rm -f stamp-h.in
        echo timestamp > stamp-h.in])
  dnl   touch Makefile.in
  dnl   sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
*** 1.2 2000/11/03 22:31:32
--- Makefile.in 2000/11/21 09:59:49
***************
*** 275,280 ****
--- 275,281 ----
        else :; fi
  $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
        cd $(top_srcdir) && $(AUTOHEADER)
+       @rm -f $(srcdir)/stamp-h.in
        @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null

  mostlyclean-hdr:
*** 1.1 2000/11/02 09:33:15
--- popt/Makefile.in    2000/11/21 10:07:00
***************
*** 215,220 ****
--- 215,221 ----
        else :; fi
  $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
        cd $(top_srcdir) && $(AUTOHEADER)
+       @rm $(srcdir)/stamp-h.in
        @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null

  mostlyclean-hdr:

Comment 1 Paul Shearer 2000-11-21 10:29:58 UTC
Created attachment 5603 [details]
rpm-3.0.6_IBM_patch_003.txt  Patch file to patch configure.in  Makefile.in  popt/Makefile.in

Comment 2 Jeff Johnson 2001-08-24 17:19:21 UTC
This bug will be addressed after rpm-4.0.3 is released.