Red Hat Bugzilla – Bug 972805
False positive for the presence of %packager macro if the macro is present in ~/.rpmmacros
Last modified: 2013-10-29 11:12:16 EDT
Description of problem:
There is false positive for the presence of %packager macro in SPEC if the macro is present in the ~/.rpmmacros.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Locate PACKAGE.spec that doesn't contain the %packager macro.
2. echo '%packager Joe Hacker' >> ~/.rpmmacros
3. fedora-review -n PACKAGE
[!]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
Note: Found : Packager: Joe Hacker
No packager macro problem
Well..there is basically no way (that I know of) how we can differentiate between macros set up in /etc/rpm/macros*, ~/.rpmmacros or spec file itself unfortunately.
I would suggest setting your packager information in RPM_PACKAGER environment variable instead. RPM tools know and use it (at least rpmdev-bumpspec does)
(In reply to Stanislav Ochotnicky from comment #1)
> Well..there is basically no way (that I know of) how we can differentiate
> between macros set up in /etc/rpm/macros*, ~/.rpmmacros or spec file itself
Could you run it in the chroot, sandbox or under special user? Or simply unset the HOME var before calling the RPM, e.g. the following workaround seems to work:
$ HOME=/tmp fedora-review
> I would suggest setting your packager information in RPM_PACKAGER
> environment variable instead. RPM tools know and use it (at least
> rpmdev-bumpspec does)
OK, but I still think the must/should items shouldn't be influenced by the user specific / env settings.
I can see that this actually is a problem when using %packager in ~/.rpmmacros. But since there seems to be reasonable way to handle this within current rpm framwork I'm closing as WONTFIX. Please feel free to reopen bug if you have more input!
I think the tool shouldn't do it, it should be objective and ignore user specific settings.
I think you should point the HOME to some temporal location during the review or do the review under special user to eliminate all possible side effects of custom user settings.