Jul 27, 2011

Addition of fedpkg rpmlint

*Edit:* Yes, there is fedpkg lint but it somewhat limited so read on. Instead of addition of "rpmlint" command Pingou will improve current lint

Recently I was trying to help OpenSuSE guys with some updates to their Java stack and I was sent link to their build system. I noticed a file called jpackage-utils-rpmlintrc and this got me thinking...

What if we added rpmlint command to fedpkg with per-package rpmlint ignore settings? Turns out Pingou took my idea and implemented it in under an hour :-)

An example run:
$ fedpkg rpmlint
plexus-interpolation.spec: W: invalid-url Source0: plexus-interpolation-1.14.tar.xz
0 packages and 1 specfiles checked; 0 errors, 1 warnings.

plexus-interpolation.spec: W: invalid-url Source0: plexus-interpolation-1.14.tar.xz
plexus-interpolation.src: W: spelling-error %description -l en_US interpolator -> interpolate, interpolation, interrogator
plexus-interpolation.src: W: invalid-url Source0: plexus-interpolation-1.14.tar.xz
1 packages and 1 specfiles checked; 0 errors, 3 warnings.
2 packages run
rpmlint has not been run on rpm files but should
OK, so we can run rpmlint on spec, srpm and binary rpms with single command. But I don't like to see the same warnings all the time, because that means I will probably miss real problems when they appear. For this fedpkg rpmlint uses .rpmlint file as additional rpmlint config. So after creating:
$ cat > .rpmlint << EOF
# we have scm checkout with comment in spec
addFilter('invalid-url')
# false positive
addFilter('spelling-error.*interpolator')
EOF
$ fedpkg rpmlint
0 packages and 1 specfiles checked; 0 errors, 0 warnings.

1 packages and 1 specfiles checked; 0 errors, 0 warnings.
2 packages run
rpmlint has not been run on rpm files but should
Cool right? Pierre sent patch with this feature to fedpkg developers, so hopefully we'll see this addition soon. I then plan to add custom .rpmlint configurations to all my packages so that they will be warning-free.

Share/Save/Bookmark

3 comments:

Post a Comment
  1. Good idea, I am a new packager, currently being sponsored. I have to say though it is a great idea, maybe I will remember to give it a try instead of the normal rpmlint command

  2. Is the "rpmlint has not been run[...] but should" message a reminder to run an unfiltered rpmlint? The only thing I would want to make clear to packagers is that their local filters shouldn't be used in posting rpmlint output for package reviews. Or if nothing else, there should be a clear indicator that the output is filtered. For instance, the tool could output "filtered warnings, errors".

  3. Current "fedpkg lint" refuses to run when binary rpms are not already built. This change will run, but instead output this warning (message should probably be improved).

    I'd say that review should start with empty .rpmlint, but finish with 0 errors/warnings and possible additions of those custom rules to .rpmlint). Also, there is no way to distinguish "filtered" warnings because mechanism for their filtering is the same in global configuration we customized for Fedora guidelines.