| |
@@ -15,6 +15,7 @@
|
| |
|
| |
from libtaskotron import check
|
| |
from libtaskotron import os_utils
|
| |
+ from libtaskotron.ext.fedora import rpm_utils
|
| |
|
| |
log = logging.getLogger('rpmlint')
|
| |
log.setLevel(logging.DEBUG)
|
| |
@@ -44,11 +45,20 @@
|
| |
rpms.append(filepath)
|
| |
else:
|
| |
log.debug('Ignoring non-rpm file: %s', filepath)
|
| |
+ pkgname = rpm_utils.rpmformat(koji_build, fmt='n')
|
| |
+ rpmlintconf = os.path.join(workdir, "%s.rpmlintrc" % pkgname)
|
| |
+ if os.path.isfile(rpmlintconf):
|
| |
+ log.debug('Found rpmlint config file: %s', rpmlintconf)
|
| |
+ else:
|
| |
+ rpmlintconf = None
|
| |
+
|
| |
+ command = ['rpmlint']
|
| |
+ if rpmlintconf:
|
| |
+ command.extend(['--file', rpmlintconf])
|
| |
|
| |
# run rpmlint on SRPMs
|
| |
if srpms:
|
| |
- command = ['rpmlint'] + srpms
|
| |
- srpm_result = run_rpmlint(command)
|
| |
+ srpm_result = run_rpmlint(command + srpms)
|
| |
else:
|
| |
log.critical('No .src.rpm files found in: %s', workdir)
|
| |
log.debug('Files available in the workdir:\n%s', '\n'.join(files))
|
| |
@@ -60,8 +70,8 @@
|
| |
# network checks were already) performed on the SRPM.
|
| |
# See https://phab.qa.fedoraproject.org/T760
|
| |
if rpms:
|
| |
- command = ['rpmlint', '-o', 'NetworkEnabled False'] + rpms
|
| |
- rpm_result = run_rpmlint(command)
|
| |
+ command.extend(['--option', 'NetworkEnabled False'])
|
| |
+ rpm_result = run_rpmlint(command + rpms)
|
| |
else:
|
| |
log.warn('No binary rpm files found in: %s', workdir)
|
| |
rpm_result = Result('PASSED', "", 0, 0)
|
| |
For issue #5