Bug 473341

Summary: "macrofiles:" setting in ~/.rpmrc appears to be ignored
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: cls, fedora, ffesti, jnovy, pmatilai
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-18 06:59:28 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 Sam Varshavchik 2008-11-27 21:18:15 UTC
Description of problem:

Setting macrofiles: in ~/.rpmrc seems to be no effect. rpm continues to load macro definitions from macrofiles: defined in /usr/lib/rpm/redhat/rpmrc

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

4.6.0

How reproducible:

Always

Steps to Reproduce:
1. Put

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

into $HOME/.rpmrc

2. Run strace -s 256 rpm -q --showrc
  
Actual results:

Macro definitions from .rpmmacros (current directory) do not get loaded. strace shows that rpm never reads .rpmmacros from the current directory.

Expected results:

Expect to be able to set up default account rpm macros, plus rpm macros in an individual project directory.

Additional info:

straceing rpm shows that it never reads .rpmmacros from the home directory. No matter what you put for macrofiles: in your $HOME/.rpmrc, it gets ignored. rpm seems to take the first macrofiles: setting it finds. rpm always reads /usr/lib/rpm/redhat/rpmrc first, before $HOME/.rpmrc

Comment 1 Daniel Thompson 2008-12-05 09:21:27 UTC
I also observed this. Examining the source there is a global variable 'macrofiles' that is influenced by the command line option --macros but, unless it is indirectly accessed, doesn't appears to be modified by the rpmrc file processing. The option --macros has been around for a long time (it appears on an old fc6 box we have lying around) but is only described in the --help messages. There is no mention of it in the man page.

This could even be deliberate. Certainly the rpm5 branch/fork got rid of the rc files because, by and large, they are only ever used to change the macrofile search path. If this is the case then not enough has been ripped out, the code to handle macrofiles still exists in rpcrc.c (which means the 'wrong' value comes out when you do --showrc).

Comment 2 Panu Matilainen 2008-12-05 09:50:49 UTC
It's indeed intentional - one step towards phasing out rpmrc as we know it.
--macros=<file1[:file2:...]> can be used to override the default list of macros to read.

But ok, documentation wrt this needs updating, at least man pages and release notes.

Comment 3 Daniel Thompson 2008-12-06 11:47:40 UTC
May I also suggest removing the macrofiles entry in the rpmrc options table. That way I'd get an error when I try to use the old approach (meaning I go and read the release notes more swiftly).

Comment 4 Chris Seawood 2008-12-16 22:21:57 UTC
Hrm. How long as --macros been available?  I updated our rpm generator to use --macros and the build fails on CentOS 5.2 using rpm 4.4.2-48.el5 because it ignored the custom rpmmacros file.  I could leave the macrofiles entry so that builds on the older distributions still work but that won't work if you make macrofiles throw an error (which it properly should).  Any ideas on how to make this work that doesn't require a semi-lame version check?

Comment 5 Bug Zapper 2009-11-18 09:00:50 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Bug Zapper 2009-12-18 06:59:28 UTC
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.