Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 157015 - rpmbuild should ignore backup files in /etc/rpm
rpmbuild should ignore backup files in /etc/rpm
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-05-05 21:19 EDT by Robin Green
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-08-26 23:00:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robin Green 2005-05-05 21:19:38 EDT
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):

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
+ 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
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf %{_bogo}_1_1_src
... etc.
Comment 1 Jeff Johnson 2005-08-26 23:00:40 EDT
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/

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

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