Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1019204 - SpecCheck is hardcoded to be the only check to run on spec files
Summary: SpecCheck is hardcoded to be the only check to run on spec files
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmlint
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Michael S.
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-10-15 09:44 UTC by Miro Hrončok
Modified: 2013-10-31 20:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-10-31 20:46:07 UTC
Type: Bug

Attachments (Terms of Use)

Description Miro Hrončok 2013-10-15 09:44:33 UTC
Although rpmlint comes with variety of checks and allows the user to configure whatever to run a certain check or not, when it comes to checking spec files, only SpecCheck is hardcoded to run.

Even if SpecCheck is disabled, it will be run on spec files. Even if other checks provide spec checks, and are enabled, they will not run on spec files.

This is certainly an upstream bug, however the upstream bug tracker at SourceForge won't let me file a bug.

We've been discussing this via e-mail with Michael Scherer and Ville Skyttä, however the discussion seems stalled. Other people are asking me about it, so this is created mainly for the reason of public discussion.

What I proposed:

Let all checks implement three methods:

 * check_spec(self, pkg)
 * check_binary(self, pkg)
 * check_sources(self, pkg)

pkg should than contain some structures: spec_file, files, doc_files..., sources (without spec files)

If the check is not interested in a certain category is either doesn't implement the method or implement it doing nothing (pass).

All around rpmlint, where SpecCheck is called directly, all check_spec()s from allowed checks are called instead - similar to how runChecks() works but calling check_spec (and setting pkg.spec_file) instead of just check().

That is:

 * when input is from stdin
 * when input is a filename that ends with .spec
 * when input is a directory and file in it ends with .spec

Later on, where runChecks() comes in game, we can keep the things as they are, but we have to be sure, that check() is only in AbstractCheck and it determines whenever to call certain methods form above list. E.g. something like this:

    def check(self, pkg):
        '''Determine what checks to run on what'''
        if not pkg.isSource():
        for fname, pkgfile in pkg.files().items():
            if fname.endswith('.spec'):
                if pkg.spec_file:
                    printError(pkg, 'multiple-specfiles', spec_file, fname)
                    pkg.spec_file = fname

[This is just very rough draft]

And again: I'm willing to send patches, just give me blessing or speak against that approach.

Comment 1 Miro Hrončok 2013-10-31 20:46:07 UTC
since upstream bug tracker is now open for strangers, I've moved this thing there, where it belongs.

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