Bug 471006 - rpmbuild applies patches with -s
rpmbuild applies patches with -s
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-11 06:11 EST by Jan Pazdziora
Modified: 2013-07-02 19:32 EDT (History)
4 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Jan Pazdziora 2008-11-11 06:11:54 EST
+++ This bug was initially created as a clone of Bug #471005 +++

Description of problem:

When rpmbuild applies patches, it calls patch with the -s option even if in the .spec file the -s is not specified. This hides warnings from build log, which could lead to things like .orig files being packaged in the rpm. This actually happened with the perl-Frontier-RPC-0.07-7.el5 package.

Version-Release number of selected component (if applicable):

# rpm -qf /usr/bin/rpmbuild
rpm-build-4.4.2-48.el5

How reproducible:

Deterministic.

Steps to Reproduce:
1. run rpmbuild -bp on package which has patches that have non-zero offsets. For example for perl-Frontier-RPC-0.07-7.el5:
# rpmbuild -bp Frontier-RPC.spec
  
Actual results:

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.46867
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf Frontier-RPC-0.07b4p1
+ /bin/gzip -dc /usr/src/redhat/SOURCES/Frontier-RPC-0.07b4p1.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd Frontier-RPC-0.07b4p1
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (perl-frontier-raw-call.patch):'
Patch #0 (perl-frontier-raw-call.patch):
+ patch -p1 -s
+ echo 'Patch #1 (perl-frontier-raw-serve.patch):'
Patch #1 (perl-frontier-raw-serve.patch):
+ patch -p1 -s
+ echo 'Patch #2 (perl-frontier-undef-scalar.patch):'
Patch #2 (perl-frontier-undef-scalar.patch):
+ patch -p1 -s
+ echo 'Patch #3 (security-xml-external-entity.patch):'
Patch #3 (security-xml-external-entity.patch):
+ patch -p1 -s
+ echo 'Patch #4 (apache2.patch):'
Patch #4 (apache2.patch):
+ patch -p1 -s
+ exit 0

Observe the -s in the patch command line. Check the .spec file that there is not such -s there. Also see ../BUILD/Frontier-RPC-0.07b4p1/lib/Frontier/*.orig -- it has .orig files which should not be there:

-rw-r--r-- 1 root root  7210 Apr 30  2007 ../BUILD/Frontier-RPC-0.07b4p1/lib/Frontier/Client.pm.orig
-rw-r--r-- 1 root root 18877 Nov 11 12:08 ../BUILD/Frontier-RPC-0.07b4p1/lib/Frontier/RPC2.pm.orig

Expected results:

rpmbuild should not add options that lower the verbosity of the output or that hide potential problems.

Additional info:
Comment 1 Jan Pazdziora 2008-11-11 06:12:38 EST
Fedora 9 shows the same behaviour, with

$ rpm -qf /usr/bin/rpmbuild
rpm-build-4.4.2.3-2.fc9.x86_64
Comment 2 Jindrich Novy 2008-11-14 09:20:27 EST
Fixed upstream.

rpmbuild now allows setting customized patch flags via _default_patch_flags macro. It defaults to "-s" but could be changed by user when needed.

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