Bug 972805 - False positive for the presence of %packager macro if the macro is present in ~/.rpmmacros
False positive for the presence of %packager macro if the macro is present in...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: fedora-review (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Stanislav Ochotnicky
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 11:35 EDT by Jaroslav Škarvada
Modified: 2013-10-29 11:12 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-30 09:40:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jaroslav Škarvada 2013-06-10 11:35:52 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):
fedora-review-0.4.1-1.fc18.noarch

How reproducible:
Always

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

Actual results:
...
Generic:
[!]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
     Note: Found : Packager: Joe Hacker
...

Expected results:
No packager macro problem

Additional info:
Comment 1 Stanislav Ochotnicky 2013-06-11 04:00:50 EDT
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)
Comment 2 Jaroslav Škarvada 2013-06-17 06:05:30 EDT
(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
> unfortunately. 
> 
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.
Comment 3 Alec Leamas 2013-08-30 09:40:46 EDT
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!
Comment 4 Jaroslav Škarvada 2013-08-30 10:10:50 EDT
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.

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