Red Hat Bugzilla – Bug 473341
"macrofiles:" setting in ~/.rpmrc appears to be ignored
Last modified: 2009-12-18 01:59:28 EST
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
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).
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.
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).
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?
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
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.