This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 239611 - percent-in-%post false positive
percent-in-%post false positive
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: rpmlint (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-09 16:59 EDT by Bernard Johnson
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 0.81-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-07 13:21:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Bernard Johnson 2007-05-09 16:59:55 EDT
Description of problem:
I think I'm right here anyway...

The following shell fragement generates a false positive:
let rand=${RANDOM}%%${max}

If rpmlint encounters %% it should not report this.

rpmlint mypackage.rpm
W: mypackage percent-in-%post

Version-Release number of selected component (if applicable):
rpmlint-0.80-1.fc6
Comment 1 Ville Skyttä 2007-05-10 02:52:02 EDT
(In reply to comment #0)
> The following shell fragement generates a false positive:
> let rand=${RANDOM}%%${max}
> 
> If rpmlint encounters %% it should not report this.

There seems to be some bogosity in the percent-in-* check indeed, but note that
rpmlint does not encounter a "%%", PostCheck.py which reports the warning sees a
single "%" as it basically inspects the equivalent of the output of rpm -qp
--scripts mypackage.rpm
Comment 2 Bernard Johnson 2007-05-10 14:01:18 EDT
Oh, I think I see now.  So when it sees a % in the output of rpm -qp --scripts
mypackage.rpm, it thinks that some important macro may have not been substituted?

Seems like it would be safe to only look for %[a-z,A-Z]* though.
Comment 3 Ville Skyttä 2007-05-10 15:36:53 EDT
Right.  In case you've looked at the code, I have absolutely no idea why it
first checks if there's a (shell-uncommented) %, then if there's a %%, and if
the latter is found, it doesn't warn.  Maybe a thinko by whoever wrote that code.

I suppose using simply the regexp %{?\w would be a candidate fix.
Comment 4 Jeff Johnson 2007-05-10 22:23:27 EDT
The usage case for '%' within %post et al scriptlets is very obscure, and likely
to get worse when I expand scriptlets at install, not build, time by escaping
macro expansions.

FWIW a seiries of %%% followed by { is likelier to be an unexpanded -- which is an error - or
intentionally delayed by escaping -- which is not an error -- macro expansion than any conceivable
shell or CLI usage of %.
Comment 5 Ville Skyttä 2007-05-12 04:58:54 EDT
Yeah, it's already pretty much impossible to get this particular check to be too
reliable, and sounds like it might get even more so in the future.  Anyway, I
think changing the regexp is an improvement right now, so done upstream:
http://rpmlint.zarb.org/cgi-bin/trac.cgi/changeset/1338
Comment 6 Fedora Update System 2007-09-07 13:21:32 EDT
rpmlint-0.81-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

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