Bug 157015

Summary: rpmbuild should ignore backup files in /etc/rpm
Product: [Fedora] Fedora Reporter: Robin Green <greenrd>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WONTFIX QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: n3npq
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-27 03:00:40 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:

Description Robin Green 2005-05-06 01:19:38 UTC
Description of problem:
When editing macro files in /etc/rpm, a backup file may be left behind by the
text editor, i.e. a file ending in ~. This backup file is picked up by rpmbuild,
resulting in confusion for the user as the old macros are still in effect, until
the file is changed again and saved. The symptom of this problem is that the
penultimate changes made to a macro file, instead of the last changes made, take
effect in an rpmbuild.

Version-Release number of selected component (if applicable):
rpm-build-4.4.1-18.1

How reproducible:
Every time

Steps to Reproduce:
1. echo '%_bogo  foo' >/etc/rpm/macros.bogus~   
2. Take an existing .spec file, e.g. coreutils.spec, and replace the Name:
coreutils line with Name: %{_bogo}
3. rpmbuild -bp the spec file just edited
4. Press ctrl+c to kill the build
  
Actual results:
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf foo_1_1_src
... etc.

Expected results:
rpmbuild should say 
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf %{_bogo}_1_1_src
... etc.

Comment 1 Jeff Johnson 2005-08-27 03:00:40 UTC
Rpm reads what is configured in the macrofiles: directive.

The default value for that includes a glob:

macrofiles:     /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/etc/rpm/macros.*:/etc/rpm/
macros:/etc/rpm/%{_target}/macros:~/.rpmmacros

Changer that to something else, or remove your backup files in /etc/rpm if you wish different behavior.