SHA256
1
0
forked from pool/rpmlint

Accepting request 67998 from Base:System

Accepted submit request 67998 from user coolo

OBS-URL: https://build.opensuse.org/request/show/67998
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=101
This commit is contained in:
Sascha Peilicke 2011-04-21 10:12:02 +00:00 committed by Git OBS Bridge
parent 3ca36e35ac
commit 10a26d790a
50 changed files with 420 additions and 314 deletions

View File

@ -50,9 +50,11 @@ class CheckInitScripts(AbstractCheck.AbstractFilesCheck):
'$portmap',
'$remote_fs',
'$syslog',
'$time', '$ALL'):
'$time',
'$null',
'$ALL'):
printError(pkg, "init-script-undefined-dependency", f, dep)
if dep in ('portmap', 'syslog', 'named', 'network', 'xntpd'):
if dep in ('portmap', 'syslog', 'named', 'network', 'ntp', 'ntpd', 'xntpd'):
printWarning(pkg, "init-script-non-var-dependency", f, dep)
if dep in ('$remote_fs'):
found_remote_fs = True
@ -61,9 +63,11 @@ class CheckInitScripts(AbstractCheck.AbstractFilesCheck):
if l.startswith('# Default-Start'):
for dep in l.split()[2:]:
if boot_script and dep not in ('B', 'S'):
printError(pkg, "init-script-wrong-start-level", f, dep)
printError(pkg, "init-script-boot_d", f)
if not boot_script and dep in ('B'):
printError(pkg, "init-script-wrong-start-level", f, dep)
printError(pkg, "init-script-not-boot_d", f, dep)
if dep == '4':
printError(pkg, "init-script-runlevel-4", f)
if not found_remote_fs and bins_list:
printWarning(pkg, "non-remote_fs-dependency", f)
@ -77,21 +81,34 @@ if Config.info:
"""Your package contains a /etc/init.d script that specifies a
dependency that is not listed in /etc/insserv.conf. Check for
typos.""",
'init-script-non-var-dependency',
"""Your package contains a /etc/init.d script that specifies
a hardcoded dependency that likely should be a variable dependency.
For example portmap should actually be $portmap, and similar.""",
'obsolete-init-keyword',
"""Your package contains a /etc/init.d script that specifies
an obsolete keyword, like X-UnitedLinux-Should-Start. Consider
using the LSB equivalent Should-Start instead.""",
'init-script-wrong-start-level',
"""Your package contains a /etc/init.d script that specifies
that it should be run in boot level but isn't named with a boot prefix
or specifies a non-boot level but has boot prefix. Fix your script.""",
'init-script-boot_d',
"""The init script has a "boot." prefix but actually lacks 'B' in
'Default-Start'. Either rename the script or add
'B' to 'Default-Start'""",
'init-script-not-boot_d',
"""The init script specifies that it should be run in level 'B' but
doesn't have a "boot." prefix. Either rename the script or remove
the 'B' from 'Default-Start'""",
'non-remote_fs-dependency',
"""Your package contains a /etc/init.d script that does not specify
$remote_fs as a start dependency, but the package also contains
files packaged in /usr. Make sure that your start script does not
call any of them, or add the missing $remote_fs dependency."""
call any of them, or add the missing $remote_fs dependency.""",
'init-script-runlevel-4',
"""The init script refers to runlevel 4 which is admin defined. No
distribution script must use it. Remove '4' from 'Default-Start'.""",
)

View File

@ -165,8 +165,26 @@ class SUIDCheck(AbstractCheck.AbstractCheck):
'%(file)s is packaged with world writable permissions (0%(mode)o)' % \
{ 'file':f, 'mode':mode })
script = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
found = False
if script:
for line in script.split("\n"):
if "chkstat -n" in line and f in line:
found = True
break
if "SuSEconfig --module permissions" in line:
found = True
found_suseconfig = True
break
if need_verifyscript and \
(not f in self.perms or not 'static' in self.perms[f]):
if not script or not found:
printError(pkg, 'permissions-missing-postin', \
"missing %%set_permissions %s in %%post" % f)
need_set_permissions = True
script = pkg[rpm.RPMTAG_VERIFYSCRIPT] or pkg[rpm.RPMTAG_VERIFYSCRIPTPROG]
@ -182,23 +200,6 @@ class SUIDCheck(AbstractCheck.AbstractCheck):
"missing %%verify_permissions -e %s" % f)
script = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
found = False
if script:
for line in script.split("\n"):
if "chkstat -n" in line and f in line:
found = True
break
if "SuSEconfig --module permissions" in line:
found = True
found_suseconfig = True
break
if not script and not found:
printError(pkg, 'permissions-missing-postin', \
"missing %%set_permissions %s in %%post" % f)
if need_set_permissions:
if not 'permissions' in map(lambda x: x[0], pkg.prereq()):
printError(pkg, 'permissions-missing-requires', \

View File

@ -2,7 +2,7 @@ Index: Pkg.py
===================================================================
--- Pkg.py.orig
+++ Pkg.py
@@ -425,6 +425,10 @@ class Pkg:
@@ -429,6 +429,10 @@ class Pkg:
self._missingok_files = None
self._files = None
self._requires = None
@ -13,7 +13,7 @@ Index: Pkg.py
self._req_names = -1
if header:
@@ -656,6 +660,22 @@ class Pkg:
@@ -666,6 +670,22 @@ class Pkg:
self._gatherDepInfo()
return self._requires
@ -36,7 +36,7 @@ Index: Pkg.py
def prereq(self):
"""Get package PreReqs as list of
(name, flags, (epoch, version, release)) tuples."""
@@ -692,7 +712,7 @@ class Pkg:
@@ -702,7 +722,7 @@ class Pkg:
# internal function to gather dependency info used by the above ones
def _gather_aux(self, header, list, nametag, flagstag, versiontag,
@ -45,7 +45,7 @@ Index: Pkg.py
names = header[nametag]
flags = header[flagstag]
versions = header[versiontag]
@@ -703,7 +723,11 @@ class Pkg:
@@ -713,7 +733,11 @@ class Pkg:
if prereq is not None and flags[loop] & PREREQ_FLAG:
prereq.append((names[loop], flags[loop] & (~PREREQ_FLAG),
evr))
@ -58,7 +58,7 @@ Index: Pkg.py
list.append((names[loop], flags[loop], evr))
def _gatherDepInfo(self):
@@ -713,6 +737,10 @@ class Pkg:
@@ -723,6 +747,10 @@ class Pkg:
self._provides = []
self._conflicts = []
self._obsoletes = []
@ -69,7 +69,7 @@ Index: Pkg.py
self._gather_aux(self.header, self._requires,
rpm.RPMTAG_REQUIRENAME,
@@ -732,6 +760,32 @@ class Pkg:
@@ -742,6 +770,32 @@ class Pkg:
rpm.RPMTAG_OBSOLETEFLAGS,
rpm.RPMTAG_OBSOLETEVERSION)

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1665,7 +1665,10 @@ executed.''',
@@ -1679,7 +1679,10 @@ executed.''',
executed.''',
'wrong-script-interpreter',

View File

@ -2,7 +2,7 @@ Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -594,7 +594,7 @@ versions you can ignore this warning.'''
@@ -619,7 +619,7 @@ versions you can ignore this warning.'''
'hardcoded-path-in-buildroot-tag',
'''A path is hardcoded in your Buildroot tag. It should be replaced

View File

@ -1,6 +1,8 @@
--- SpecCheck.py
Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -223,7 +223,9 @@
@@ -223,7 +223,9 @@ class SpecCheck(AbstractCheck.AbstractCh
continue

19
config
View File

@ -1,10 +1,12 @@
# -*- python -*-
# vim: syntax=python
# Configuration for the rpmlint utility.
# Loaded before ~/.rpmlintrc
# $Id: config,v 1.39 2003/12/22 11:20:55 flepied Exp $
# This line is mandatory to access the configuration functions
from Config import *
from Filter import addDetails
# Additionale path to look for checks
@ -256,6 +258,16 @@ setOption('StandardUsers', (
'zope',
))
addDetails('non-standard-uid',
'''A file in this package is owned by an unregistered user id.
Please contact opensuse-packaging@opensuse.org to register the user.
''',
'non-standard-gid',
'''A file in this package is owned by an unregistered group id.
Please contact opensuse-packaging@opensuse.org to register the group.
'''
)
setOption('DanglingSymlinkExceptions',
(['/usr/share/doc/licenses/', 'licenses'],
['consolehelper$', 'usermode-consoleonly'],
@ -399,12 +411,17 @@ setOption("DBUSServices.WhiteList", (
# kdebase4-runtime, bnc#672145
"org.kde.powerdevil.backlighthelper.service",
"org.kde.powerdevil.backlighthelper.conf",
# urfkill (bnc#688328)
"org.freedesktop.URfkill.service",
"org.freedesktop.URfkill.conf",
))
# Output filters
addFilter(".*spurious-bracket-in-.*")
addFilter(".*one-line-command-in-.*")
addFilter(" dir-or-file-in-opt")
addFilter(" dir-or-file-in-opt ") # handled by CheckFilelist.py
addFilter(" dir-or-file-in-usr-local ") # handled by CheckFilelist.py
addFilter(" non-standard-dir-in-usr ") # handled by CheckFilelist.py
addFilter("incoherent-version-in-changelog")
addFilter(" no-signature")
addFilter(" symlink-crontab-file") #bnc591431

View File

@ -1,10 +1,10 @@
# Confusing message. The problem is not that the file does not end
# with ".spec", but that there is a mismatch of specname and pkg name.
Index: rpmlint-0.99/SpecCheck.py
Index: rpmlint-1.1/SpecCheck.py
===================================================================
--- rpmlint-0.99.orig/SpecCheck.py
+++ rpmlint-0.99/SpecCheck.py
@@ -568,8 +568,8 @@ addDetails(
--- rpmlint-1.1.orig/SpecCheck.py
+++ rpmlint-1.1/SpecCheck.py
@@ -593,8 +593,8 @@ addDetails(
SPEC file to build a valid RPM package.''',
'invalid-spec-name',

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -698,6 +698,9 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -702,6 +702,9 @@ class TagsCheck(AbstractCheck.AbstractCh
if not description:
printError(pkg, 'no-description-tag')
else:
@ -12,7 +12,7 @@ Index: TagsCheck.py
if not pkg[rpm.RPMTAG_HEADERI18NTABLE]:
self._unexpanded_macros(pkg, '%description', description)
else:
@@ -969,6 +972,10 @@ Name tag.''',
@@ -983,6 +986,10 @@ Name tag.''',
'''The major number of the library isn't included in the package's name.
''',

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -826,6 +826,10 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -842,6 +842,10 @@ class FilesCheck(AbstractCheck.AbstractC
# Check if the package is a development package
devel_pkg = devel_regex.search(pkg.name)

View File

@ -10,7 +10,7 @@ Index: FilesCheck.py
# room for improvement with catching more -R, but also for false positives...
buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b')
sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$')
@@ -1168,7 +1169,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1188,7 +1189,7 @@ class FilesCheck(AbstractCheck.AbstractC
includefile_regex.search(f) or \
develfile_regex.search(f) or \
logrotate_regex.search(f)
@ -19,7 +19,7 @@ Index: FilesCheck.py
printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \
f not in ghost_files:
@@ -1539,7 +1540,10 @@ included in your package.''',
@@ -1553,7 +1554,10 @@ included in your package.''',
'spurious-executable-perm',
'''The file is installed with executable permissions, but was identified as one
that probably should not be executable. Verify if the executable bits are

View File

@ -1,6 +1,8 @@
--- FilesCheck.py
Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1200,7 +1200,7 @@
@@ -1206,7 +1206,7 @@ class FilesCheck(AbstractCheck.AbstractC
if nonexec_file and not docdir_examples_regex.search(f):
printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \

View File

@ -1,6 +1,8 @@
--- Filter.py
Index: Filter.py
===================================================================
--- Filter.py.orig
+++ Filter.py
@@ -22,13 +22,8 @@
@@ -22,13 +22,8 @@ _diagnostic = list()
_badness_score = 0
printed_messages = { "I": 0, "W": 0, "E": 0 }

View File

@ -1,13 +0,0 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -644,8 +644,8 @@
printWarning(pkg,
'incoherent-version-dependency-on',
base_or_libs,
- Pkg.versionToString(dep[2][0],
- dep[2][1], None),
+ Pkg.versionToString((dep[2][0],
+ dep[2][1], None)),
sexp)
res = devel_number_regex.search(name)
if not res:

View File

@ -1,6 +1,8 @@
--- TagsCheck.py
Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -419,6 +419,7 @@
@@ -421,6 +421,7 @@ invalid_version_regex = re.compile('([0-
# () are here for grouping purpose in the regexp
forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE)
valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost'))
@ -8,7 +10,7 @@
use_epoch = Config.getOption('UseEpoch', False)
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
max_line_len = Config.getOption('MaxLineLength', 79)
@@ -597,6 +598,9 @@
@@ -601,6 +602,9 @@ class TagsCheck(AbstractCheck.AbstractCh
if d[0].startswith('/usr/local/'):
printError(pkg, 'invalid-dependency', d[0])
@ -18,7 +20,7 @@
if not devel_depend and not is_devel and not is_source and \
FilesCheck.devel_regex.search(d[0]):
printError(pkg, 'devel-dependency', d[0])
@@ -1063,6 +1067,12 @@
@@ -1085,6 +1089,12 @@ explicit Requires: tags.''',
'''This package provides 2 times the same capacity. It should only provide it
once.''',

View File

@ -2,7 +2,7 @@ Index: Filter.py
===================================================================
--- Filter.py.orig
+++ Filter.py
@@ -104,7 +104,7 @@ def printAllReasons():
@@ -109,7 +109,7 @@ def printAllReasons():
if len(last_reason):
printDescriptions(last_reason)
last_reason = reason
@ -11,11 +11,11 @@ Index: Filter.py
if Config.info and len(last_reason):
printDescriptions(last_reason)
_diagnostic = list()
Index: rpmlint.py
Index: rpmlint
===================================================================
--- rpmlint.py.orig
+++ rpmlint.py
@@ -202,7 +202,7 @@ def main():
--- rpmlint.orig
+++ rpmlint
@@ -211,7 +211,7 @@ def main():
% (packages_checked, specfiles_checked,
printed_messages["E"], printed_messages["W"])

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -843,7 +843,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -859,7 +859,7 @@ class FilesCheck(AbstractCheck.AbstractC
debuginfo_srcs = False
debuginfo_debugs = False

View File

@ -11,7 +11,7 @@ Index: InitScriptCheck.py
chkconfig_content_regex = re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+')
subsys_regex = re.compile('/var/lock/subsys/([^/"\'\n\s;&|]+)', re.MULTILINE)
@@ -53,6 +53,9 @@ class InitScriptCheck(AbstractCheck.Abst
@@ -64,6 +64,9 @@ class InitScriptCheck(AbstractCheck.Abst
not fname.startswith('/etc/rc.d/init.d/'):
continue

View File

@ -1,8 +1,10 @@
--- TagsCheck.py
Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -427,13 +427,6 @@
sentence_break_regex = re.compile(r'(^|[.:;!?])\s*$')
so_dep_regex = re.compile(r'\.so(\.[0-9a-zA-z]+)*(\([^)]*\))*$')
@@ -433,13 +433,6 @@ so_dep_regex = re.compile(r'\.so(\.[0-9a
# we assume that no rpm packages existed before rpm itself existed...
oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d"))
-private_so_paths = set()
-for path in ('%perl_archlib', '%perl_vendorarch', '%perl_sitearch',
@ -14,7 +16,7 @@
_enchant_checkers = {}
def spell_check(pkg, str, fmt, lang, ignored):
@@ -814,30 +807,12 @@
@@ -852,30 +845,12 @@ class TagsCheck(AbstractCheck.AbstractCh
(apply(Pkg.formatRequire, obs),
apply(Pkg.formatRequire, prov)))

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -708,6 +708,8 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -712,6 +712,8 @@ class TagsCheck(AbstractCheck.AbstractCh
self._unexpanded_macros(pkg, 'Group', group)
if not group:
printError(pkg, 'no-group-tag')
@ -11,7 +11,7 @@ Index: TagsCheck.py
elif VALID_GROUPS and group not in VALID_GROUPS:
printWarning(pkg, 'non-standard-group', group)
@@ -1008,6 +1010,10 @@ won't fool the specfile parser, and rebu
@@ -1022,6 +1024,10 @@ won't fool the specfile parser, and rebu
'''There is no Group tag in your package. You have to specify a valid group
in your spec file using the Group tag.''',

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:504ea4212812993b19de3e12dffb9bbe0cd9dac9e46f7c55760428f1bc77b814
size 123667

3
rpmlint-1.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:975c527be44e4b086362fcd1aa0eca37633474cabcc20f9b5ab200eb638b274a
size 125067

28
rpmlint-add-details.diff Normal file
View File

@ -0,0 +1,28 @@
From c7aa88a93128892705322c564e849ca2a6a74b5b Mon Sep 17 00:00:00 2001
From: scop <scop@9bc8b190-ac0f-0410-8968-dc7d1f502856>
Date: Thu, 10 Mar 2011 17:29:42 +0000
Subject: [PATCH] Don't overwrite already existing details (Ludwig Nussel).
This allows the distro config to provide alternative descriptions and
distro specific explanations without having to patch checks.
git-svn-id: http://rpmlint.zarb.org/svn/trunk@1845 9bc8b190-ac0f-0410-8968-dc7d1f502856
---
Filter.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
Index: rpmlint-1.1/Filter.py
===================================================================
--- rpmlint-1.1.orig/Filter.py
+++ rpmlint-1.1/Filter.py
@@ -115,7 +115,8 @@ _details = {}
def addDetails(*details):
for idx in range(len(details)/2):
- _details[details[idx*2]] = details[idx*2+1]
+ if not details[idx*2] in _details:
+ _details[details[idx*2]] = details[idx*2+1]
def badnessScore():
global _badness_score

View File

@ -1,30 +0,0 @@
From c887ed177b551186dc30f7528cd23c018ca2b69d Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Thu, 4 Nov 2010 17:25:35 +0100
Subject: [PATCH] allow info messages even if badness scoring is used
---
Filter.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Filter.py b/Filter.py
index 4b5ca1e..baaee45 100644
--- a/Filter.py
+++ b/Filter.py
@@ -47,7 +47,12 @@ def _print(msgtype, pkg, reason, details):
badness = 0
if threshold >= 0:
badness = Config.badness(reason)
- msgtype = badness and "E" or "W"
+ # anything with badness is an error
+ if badness:
+ msgtype == 'E'
+ # errors without badness become warnings
+ elif msgtype == 'E':
+ msgtype = 'W'
ln = ""
if pkg.current_linenum is not None:
--
1.7.1

View File

@ -1,44 +0,0 @@
From 1300bf63e4f5e345329b040e3ccd982c02ee35bd Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Wed, 3 Nov 2010 16:57:00 +0100
Subject: [PATCH] make file capabilities available in PkgFile
---
Pkg.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Pkg.py b/Pkg.py
index 73bd0ba..a2c864d 100644
--- a/Pkg.py
+++ b/Pkg.py
@@ -603,6 +603,10 @@ class Pkg:
provides = self.header[rpm.RPMTAG_FILEPROVIDE]
files = self.header[rpm.RPMTAG_FILENAMES]
magics = self.header[rpm.RPMTAG_FILECLASS]
+ try:
+ filecaps = self.header[rpm.RPMTAG_FILECAPS]
+ except:
+ filecaps = None
# rpm-python < 4.6 does not return a list for this (or FILEDEVICES,
# FWIW) for packages containing exactly one file
@@ -629,6 +633,8 @@ class Pkg:
pkgfile.requires = parse_deps(requires[idx])
pkgfile.provides = parse_deps(provides[idx])
pkgfile.lang = langs[idx]
+ if filecaps:
+ pkgfile.filecaps = filecaps[idx]
pkgfile.magic = magics[idx]
if not pkgfile.magic and _magic:
pkgfile.magic = _magic.file(pkgfile.path)
@@ -806,6 +812,7 @@ class PkgFile(object):
self.provides = []
self.lang = ''
self.magic = ''
+ self.filecaps = None
# TODO: decompression support
--
1.7.1

View File

@ -2,7 +2,7 @@ Index: Pkg.py
===================================================================
--- Pkg.py.orig
+++ Pkg.py
@@ -492,7 +492,7 @@ class Pkg:
@@ -496,7 +496,7 @@ class Pkg:
dir = self.dirname)
# TODO: better shell escaping or sequence based command invocation
command_str = \

View File

@ -1,3 +1,51 @@
-------------------------------------------------------------------
Wed Apr 20 17:31:23 CEST 2011 - dmueller@suse.de
- fix sysv5-init-check.diff to check for preun, not postin
-------------------------------------------------------------------
Tue Apr 19 14:05:01 UTC 2011 - lnussel@suse.de
- update CheckInitScripts.py:
* add check for runlevel 4
* clarify boot.* error
* accept $null in start/stop tags
- also check for %run_permissions if package doesn't actually need permissions
handling
- merge suse-binarieschecks.diff and suse-hide-unstripped-outside-build.diff
and fix the former
-------------------------------------------------------------------
Tue Apr 19 08:35:47 UTC 2011 - lnussel@suse.de
- ignore dir-or-file-in-usr-local as it's handled by CheckFilelist.py
- non-standard-dir-in-usr dito
-------------------------------------------------------------------
Tue Apr 19 07:26:44 UTC 2011 - lnussel@suse.de
- add urfkill (bnc#688328))
-------------------------------------------------------------------
Fri Apr 15 10:22:15 CEST 2011 - dmueller@suse.de
- update to 1.1:
- remove upstreamed patches
* FilesCheck.py: Don't crash if a file cannot be opened
* FilesCheck.py: Update expected Python 3.2 bytecode magic value
* TagsCheck.py: Improve no-description-tag info message
* TagsCheck.py: Improve changelog related info messages.
* Pkg.py: Treat 'Unspecified' as a valid Group
* TagsCheck.py: Add future and overflow checks for changelog
* FilesCheck.py: Don't emit spurious executable perm warnings for
docs with shebangs
* FilesCheck.py: Don't read "head" of files for in each test
* SpecCheck.py: Check source and patch file sizes and MD5 hashes
* Pkg.py: Fix traceback when stringifying epoch-only versions
* TagsCheck.py: Fix TypeError when outputting
* Pkg.py: Make file capabilities available in PkgFile
- add check for missing rcXXX symlinks (FATE#310641)
-------------------------------------------------------------------
Mon Mar 21 16:08:59 UTC 2011 - lnussel@suse.de
@ -9,6 +57,11 @@ Wed Mar 16 11:42:39 CET 2011 - dmueller@suse.de
- fix typo (bnc#675329)
-------------------------------------------------------------------
Thu Mar 10 11:10:15 UTC 2011 - lnussel@suse.de
- add better help message for non-standard-uid
-------------------------------------------------------------------
Wed Feb 16 10:29:14 UTC 2011 - lnussel@suse.de

View File

@ -22,7 +22,7 @@
Name: rpmlint
BuildRequires: rpm-python
Summary: Rpm correctness checker
Version: 1.0
Version: 1.1
Release: 25
Source0: %{name}-%{version}.tar.bz2
Source1: config
@ -75,12 +75,10 @@ Patch12: usr-arch.diff
Patch13: script-interpreter-only-for-exec-scripts.diff
Patch14: sourced-dirs.diff
Patch17: docdata-examples.diff
Patch18: suse-hide-unstripped-outside-build.diff
Patch19: yast-provides.diff
Patch20: xdg-paths-update.diff
Patch22: better-wrong-script.diff
Patch23: buildroot-doc.diff
# bogus, fails with aaa_base. disabled
Patch24: sysv5-init-checks.diff
Patch26: ignore-non-readable-in-etc.diff
Patch29: rpmgroup-checks.diff
@ -117,13 +115,13 @@ Patch75: stricter-interpreter-check.diff
Patch76: confusing-invalid-spec-name.patch
Patch77: rpmlint-pkg-quoting.diff
Patch78: suse-g-ir-chech.diff
Patch79: rpmlint-fscaps.diff
Patch80: remove-expand-macros.diff
Patch81: suse-whitelist-opensuse.diff
Patch82: rpmlint-badness-info.diff
Patch83: incoherent-warning-fix.diff
Patch84: extend-suse-conffiles-check.diff
Patch85: suse-changelog.patch
Patch86: suse-rclink-check.diff
# already upstream
Patch87: rpmlint-add-details.diff
%py_requires
%description
@ -155,13 +153,11 @@ Authors:
%patch13
%patch14
%patch17
%patch18
%patch19
%patch20
%patch22
%patch23
# bogus, fails with aaa_base. disabled
#patch24
%patch24
#%patch26
%patch29
%patch30
@ -197,14 +193,12 @@ Authors:
%patch76 -p1
%patch77
%patch78
%patch79 -p1
%patch80
%patch81
%patch82 -p1
%patch83
%patch84
# suse-changelog.patch
%patch85 -p1
%patch85
%patch86
%patch87 -p1
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .

View File

@ -2,12 +2,12 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1225,7 +1225,7 @@ class FilesCheck(AbstractCheck.AbstractC
interpreter = None
if res:
interpreter = res.group(1)
- if not interpreter_regex.search(interpreter):
+ if mode & 0111 != 0 and not interpreter_regex.search(interpreter):
printError(pkg, 'wrong-script-interpreter',
f, interpreter)
elif not nonexec_file and not \
@@ -1238,7 +1238,7 @@ class FilesCheck(AbstractCheck.AbstractC
elif interpreter or mode & 0111 != 0 or \
script_regex.search(f):
if interpreter:
- if not interpreter_regex.search(interpreter):
+ if mode & 0111 != 0 and not interpreter_regex.search(interpreter):
printError(pkg, 'wrong-script-interpreter',
f, interpreter)
elif not nonexec_file and not \

View File

@ -1,6 +1,8 @@
--- TagsCheck.py
Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -801,6 +801,7 @@
@@ -815,6 +815,7 @@ class TagsCheck(AbstractCheck.AbstractCh
obs_names = [x[0] for x in pkg.obsoletes()]
prov_names = [x[0].split(':/')[0] for x in pkg.provides()]
@ -8,7 +10,7 @@
for o in (x for x in obs_names if x not in prov_names):
printWarning(pkg, 'obsolete-not-provided', o)
@@ -812,6 +813,8 @@
@@ -826,6 +827,8 @@ class TagsCheck(AbstractCheck.AbstractCh
# https://bugzilla.redhat.com/460872
useless_provides = []
for p in prov_names:
@ -17,7 +19,7 @@
if prov_names.count(p) != 1 and p not in useless_provides:
useless_provides.append(p)
for p in useless_provides:
@@ -952,6 +955,10 @@
@@ -966,6 +969,10 @@ the Release tag.''',
'''There is no Name tag in your package. You have to specify a name using the
Name tag.''',

View File

@ -2,8 +2,8 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -685,7 +685,7 @@ manifest_perl_regex = re.compile('^/usr/
shebang_regex = re.compile('^#!\s*(\S*)')
@@ -686,7 +686,7 @@ manifest_perl_regex = re.compile('^/usr/
shebang_regex = re.compile('^#!\s*(\S+)')
interpreter_regex = re.compile('^/(usr/)?(s?bin|games|libexec(/.+)?|(lib(64)?|share)/.+)/[^/]+$')
script_regex = re.compile('^/((usr/)?s?bin|etc/(rc\.d/init\.d|X11/xinit\.d|cron\.(hourly|daily|monthly|weekly)))/')
-sourced_script_regex = re.compile('^/etc/(bash_completion\.d|profile\.d)/')

View File

@ -2,13 +2,13 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1248,7 +1248,8 @@ class FilesCheck(AbstractCheck.AbstractC
f.endswith('.la')):
printError(pkg, 'script-without-shebang', f)
@@ -1261,7 +1261,8 @@ class FilesCheck(AbstractCheck.AbstractC
f.endswith('.la')):
printError(pkg, 'script-without-shebang', f)
- if mode & 0111 == 0 and not is_doc:
+ if mode & 0111 == 0 and not is_doc and \
+ interpreter and interpreter.startswith("/"):
printError(pkg, 'non-executable-script', f,
oct(perm), interpreter)
if line.endswith('\r\n') or line.endswith('\r'):
- if mode & 0111 == 0 and not is_doc:
+ if mode & 0111 == 0 and not is_doc and \
+ interpreter and interpreter.startswith("/"):
printError(pkg, 'non-executable-script', f,
oct(perm), interpreter)
if '\r' in chunk:

View File

@ -1,6 +1,16 @@
--- BinariesCheck.py
Index: BinariesCheck.py
===================================================================
--- BinariesCheck.py.orig
+++ BinariesCheck.py
@@ -17,6 +17,7 @@
@@ -10,6 +10,7 @@
import re
import stat
+import os
import rpm
@@ -17,6 +18,7 @@ from Filter import addDetails, printErro
import AbstractCheck
import Config
import Pkg
@ -8,7 +18,7 @@
DEFAULT_SYSTEM_LIB_PATHS = (
@@ -37,6 +38,9 @@
@@ -37,6 +39,9 @@ class BinaryInfo:
unused_regex = re.compile('^\s+(\S+)')
exit_call_regex = re.compile('\s+FUNC\s+.*?\s+(_?exit(?:@\S+)?)(?:\s|$)')
fork_call_regex = re.compile('\s+FUNC\s+.*?\s+(fork(?:@\S+)?)(?:\s|$)')
@ -18,7 +28,7 @@
def __init__(self, pkg, path, file, is_ar, is_shlib):
self.readelf_error = False
@@ -50,7 +54,10 @@
@@ -50,7 +55,10 @@ class BinaryInfo:
self.stack = False
self.exec_stack = False
self.exit_calls = []
@ -29,7 +39,7 @@
self.tail = ''
is_debug = path.endswith('.debug')
@@ -93,6 +100,11 @@
@@ -93,6 +101,11 @@ class BinaryInfo:
self.exec_stack = True
continue
@ -41,7 +51,7 @@
if is_shlib:
r = BinaryInfo.exit_call_regex.search(l)
if r:
@@ -103,6 +115,14 @@
@@ -103,6 +116,14 @@ class BinaryInfo:
fork_called = True
continue
@ -56,7 +66,17 @@
if self.non_pic:
self.non_pic = 'TEXTREL' in res[1]
@@ -270,6 +290,17 @@
@@ -263,13 +284,26 @@ class BinariesCheck(AbstractCheck.Abstra
continue
# stripped ?
- if 'not stripped' in pkgfile.magic:
+ if 'not stripped' in pkgfile.magic and \
+ (os.environ.get('BUILD_DIR', '') == '' or
+ os.environ.get('BUILD_DEBUG', '') != ''):
printWarning(pkg, 'unstripped-binary-or-object', fname)
# inspect binary file
is_shlib = so_regex.search(fname)
bin_info = BinaryInfo(pkg, pkgfile.path, fname, is_ar, is_shlib)
@ -67,25 +87,25 @@
+ elif not bin_info.symtab:
+ printError(pkg, 'static-library-without-symtab', fname)
+ elif not bin_info.debuginfo and \
+ (os.environ.get('BUILD_IS_RUNNING', None) == None or \
+ os.environ.get('BUILD_DEBUG_FLAGS','').find('-g') != -1):
+ (os.environ.get('BUILD_DIR', '') == '' or \
+ os.environ.get('BUILD_DEBUG','') != ''):
+ printWarning(pkg, 'static-library-without-debuginfo', fname)
+
if is_shlib:
has_lib = True
@@ -319,6 +350,10 @@
@@ -319,6 +353,10 @@ class BinariesCheck(AbstractCheck.Abstra
for ec in bin_info.exit_calls:
printWarning(pkg, 'shared-lib-calls-exit', fname, ec)
+ # gethostbyname ?
+ # gethostbyname ?
+ if bin_info.calls_gethostbyname:
+ printError(pkg, 'binary-or-shlib-calls-gethostbyname', fname)
+ printInfo(pkg, 'binary-or-shlib-calls-gethostbyname', fname)
+
# rpath ?
if bin_info.rpath:
for p in bin_info.rpath:
@@ -504,6 +539,14 @@
@@ -504,6 +542,14 @@ with the intended shared libraries only.
'ldd-failed',
'''Executing ldd on this file failed, all checks could not be run.''',
@ -100,7 +120,7 @@
'executable-stack',
'''The binary declares the stack as executable. Executable stack is usually an
error as it is only needed if the code contains GCC trampolines or similar
@@ -516,6 +559,10 @@
@@ -516,6 +562,10 @@ don\'t define a proper .note.GNU-stack s
make the stack executable. Usual suspects include use of a non-GNU linker or
an old GNU linker version.''',
@ -111,3 +131,16 @@
'shared-lib-calls-exit',
'''This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
@@ -533,6 +583,12 @@ form, make sure that rpmbuild does not s
that use prelink, make sure that prelink does not strip it either, usually by
placing a blacklist file in /etc/prelink.conf.d. For more information, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''',
+
+'unstripped-binary-or-object',
+'''stripping debug info from binaries happens automatically according to global
+project settings. So there's normally no need to manually strip binaries.
+Left over unstripped binaries could therefore indicate a bug in the automatic
+stripping process.''',
)
# BinariesCheck.py ends here

View File

@ -1,6 +1,8 @@
--- SourceCheck.py
Index: SourceCheck.py
===================================================================
--- SourceCheck.py.orig
+++ SourceCheck.py
@@ -17,7 +17,7 @@
@@ -17,7 +17,7 @@ import Config
DEFAULT_VALID_SRC_PERMS = (0644, 0755)
@ -9,7 +11,7 @@
compress_ext = Config.getOption("CompressExtension", "bz2")
valid_src_perms = Config.getOption("ValidSrcPerms", DEFAULT_VALID_SRC_PERMS)
@@ -41,7 +41,7 @@
@@ -41,7 +41,7 @@ class SourceCheck(AbstractCheck.Abstract
else:
spec_file = fname
elif source_regex.search(fname) and compress_ext and \
@ -18,7 +20,7 @@
printWarning(pkg, 'source-or-patch-not-compressed',
compress_ext, fname)
perm = pkgfile.mode & 07777
@@ -58,8 +58,10 @@
@@ -58,8 +58,10 @@ all your RPM information.''',
'source-or-patch-not-compressed',
'''A source archive or file in your package is not compressed using the %s

View File

@ -1,6 +1,8 @@
--- rpmlint-1.0/TagsCheck.py.orig 2010-12-19 15:51:54.000000000 +0100
+++ rpmlint-1.0/TagsCheck.py 2010-12-19 15:56:43.000000000 +0100
@@ -1008,8 +1008,8 @@ Development/''',
Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -1022,8 +1022,8 @@ Development/''',
"%s".''' % '", "'.join(VALID_GROUPS),
'no-changelogname-tag',
@ -10,4 +12,4 @@
+spec file and prepare your changes file using e.g. the 'osc vc' command.''',
'no-version-in-last-changelog',
'''The last changelog entry doesn't contain a version. Please insert the
'''The latest changelog entry doesn't contain a version. Please insert the

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -928,6 +928,16 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -944,6 +944,16 @@ class FilesCheck(AbstractCheck.AbstractC
if res.group(1) != pkg.name:
printError(pkg, 'incoherent-logrotate-file', f)
@ -19,7 +19,7 @@ Index: FilesCheck.py
if link != '':
ext = compr_regex.search(link)
if ext:
@@ -1725,6 +1735,24 @@ consequences), or other compiler flags w
@@ -1739,6 +1749,24 @@ consequences), or other compiler flags w
extraction not working as expected. Verify that the binaries are not
unexpectedly stripped and that the intended compiler flags are used.''',

View File

@ -1,6 +1,8 @@
--- Config.py
Index: Config.py
===================================================================
--- Config.py.orig
+++ Config.py
@@ -17,14 +17,13 @@
@@ -17,14 +17,13 @@ try:
except ImportError:
__version__ = 'devel'

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -885,7 +885,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -901,7 +901,7 @@ class FilesCheck(AbstractCheck.AbstractC
is_kernel_package:
printError(pkg, "kernel-modules-not-in-kernel-packages", f)
@ -11,7 +11,7 @@ Index: FilesCheck.py
printError(pkg, 'dir-or-file-in-tmp', f)
elif f.startswith('/mnt/'):
printError(pkg, 'dir-or-file-in-mnt', f)
@@ -895,6 +895,8 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -911,6 +911,8 @@ class FilesCheck(AbstractCheck.AbstractC
printError(pkg, 'dir-or-file-in-usr-local', f)
elif f.startswith('/var/local/'):
printError(pkg, 'dir-or-file-in-var-local', f)
@ -20,7 +20,7 @@ Index: FilesCheck.py
elif sub_bin_regex.search(f):
printError(pkg, 'subdir-in-bin', f)
elif f.startswith('/home/'):
@@ -1465,6 +1467,12 @@ for packages to install files in this di
@@ -1478,6 +1480,12 @@ for packages to install files in this di
'''A file in the package is located in /var/local. It's not permitted
for packages to install files in this directory.''',

View File

@ -1,36 +0,0 @@
Index: BinariesCheck.py
===================================================================
--- BinariesCheck.py.orig
+++ BinariesCheck.py
@@ -10,6 +10,7 @@
import re
import stat
+import os
import rpm
@@ -284,7 +285,9 @@ class BinariesCheck(AbstractCheck.Abstra
continue
# stripped ?
- if 'not stripped' in pkgfile.magic:
+ if 'not stripped' in pkgfile.magic and \
+ (os.environ.get('BUILD_DIR', '') == '' or
+ os.environ.get('BUILD_DEBUG', '') != ''):
printWarning(pkg, 'unstripped-binary-or-object', fname)
# inspect binary file
@@ -581,6 +584,12 @@ form, make sure that rpmbuild does not s
that use prelink, make sure that prelink does not strip it either, usually by
placing a blacklist file in /etc/prelink.conf.d. For more information, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''',
+
+'unstripped-binary-or-object',
+'''stripping debug info from binaries happens automatically according to global
+project settings. So there's normally no need to manually strip binaries.
+Left over unstripped binaries could therefore indicate a bug in the automatic
+stripping process.''',
)
# BinariesCheck.py ends here

View File

@ -1,6 +1,8 @@
--- SpecCheck.py
Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -394,6 +394,10 @@
@@ -403,6 +403,10 @@ class SpecCheck(AbstractCheck.AbstractCh
printWarning(pkg, 'comparison-operator-in-deptoken',
conf)
@ -11,7 +13,7 @@
if current_section == 'changelog':
for match in AbstractCheck.macro_regex.findall(line):
res = re.match('%+', match)
@@ -681,6 +685,14 @@
@@ -715,6 +719,14 @@ may break short circuit builds.''',
'''Make check or other automated regression test should be run in %check, as
they can be disabled with a rpm macro for short circuiting purposes.''',

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -414,6 +414,7 @@ lib_devel_number_regex = re.compile('^li
@@ -416,6 +416,7 @@ lib_devel_number_regex = re.compile('^li
invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE)
lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE)
leading_space_regex = re.compile('^\s+')
@ -10,7 +10,7 @@ Index: TagsCheck.py
license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s')
invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
# () are here for grouping purpose in the regexp
@@ -623,10 +624,12 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -627,10 +628,12 @@ class TagsCheck(AbstractCheck.AbstractCh
base = is_devel.group(1)
dep = None
has_so = False
@ -24,7 +24,7 @@ Index: TagsCheck.py
if has_so:
base_or_libs = base + '/' + base + '-libs/lib' + base
# try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)")
@@ -663,6 +666,15 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -667,6 +670,15 @@ class TagsCheck(AbstractCheck.AbstractCh
if prov not in (x[0] for x in pkg.provides()):
printWarning(pkg, 'no-provides', prov)
@ -40,7 +40,7 @@ Index: TagsCheck.py
# List of words to ignore in spell check
ignored_words = set()
for pf in pkg.files():
@@ -1082,6 +1094,11 @@ instead or require a file in bin or /etc
@@ -1104,6 +1116,11 @@ instead or require a file in bin or /etc
'no-url-tag',
'''The URL tag is missing. Please add a http or ftp link to the project location.''',

45
suse-rclink-check.diff Normal file
View File

@ -0,0 +1,45 @@
--- InitScriptCheck.py
+++ InitScriptCheck.py
@@ -51,7 +51,7 @@
return
initscript_list = []
-
+ rclinks = set()
# check chkconfig call in %post and %preun
postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
@@ -60,6 +60,9 @@
for fname, pkgfile in pkg.files().items():
+ if stat.S_ISLNK(pkgfile.mode) and fname.startswith("/usr/sbin/rc"):
+ rclinks.add(fname.partition('/rc')[2])
+
if not fname.startswith('/etc/init.d/') and \
not fname.startswith('/etc/rc.d/init.d/'):
continue
@@ -199,6 +202,12 @@
if not subsys_regex_found:
printError(pkg, 'subsys-not-used', fname)
+ for script in initscript_list:
+ if script.startswith("rc") or script.startswith("boot."):
+ continue
+ if not script in rclinks:
+ printWarning(pkg, 'suse-missing-rclink', script)
+
goodnames = (pkg.name.lower(), pkg.name.lower() + 'd')
if len(initscript_list) == 1 and initscript_list[0] not in goodnames:
printWarning(pkg, 'incoherent-init-script-name', initscript_list[0],
@@ -229,6 +238,10 @@
'''The package contains an init script but doesn't contain a %postun
with a call to %insserv_cleanup-postun''',
+'suse-missing-rclink',
+'''The package contains an init script with the given name but does not
+have contain the SUSE policy symlink /usr/sbin/rcFOO -> /etc/init.d/FOO''',
+
'preun-without-chkconfig',
'''The package contains an init script but doesn't call chkconfig in its
%preun script.''',

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -631,10 +631,10 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -635,10 +635,10 @@ class TagsCheck(AbstractCheck.AbstractCh
if pkg_config_regex.match(fname) and fname.endswith('.pc'):
has_pc = True
if has_so:

View File

@ -1,6 +1,8 @@
--- TagsCheck.py
Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -762,7 +762,7 @@
@@ -776,7 +776,7 @@ class TagsCheck(AbstractCheck.AbstractCh
if not valid_license:
self._unexpanded_macros(pkg, 'License', rpm_license)
@ -9,7 +11,7 @@
if hasattr(rpm, 'RPMTAG_%s' % tag.upper()):
url = pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())]
self._unexpanded_macros(pkg, tag, url, is_url = True)
@@ -1070,7 +1070,7 @@
@@ -1092,7 +1092,7 @@ once.''',
'''This rpm requires a specific release of another package.''',
'no-url-tag',

View File

@ -23,7 +23,7 @@ Index: SpecCheck.py
res = prereq_regex.search(line)
if res:
printError(pkg, 'prereq-use', res.group(2))
@@ -731,6 +738,15 @@ set which may result in security issues
@@ -756,6 +763,15 @@ set which may result in security issues
depending on the system where the package is built. Add default attributes
using %defattr before it in the %files section, or use per line %attr's.''',

View File

@ -1,6 +1,8 @@
--- TagsCheck.py
Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -868,7 +868,7 @@
@@ -881,7 +881,7 @@ class TagsCheck(AbstractCheck.AbstractCh
spell_check(pkg, utf8summary, 'Summary(%s)', lang, ignored_words)
if '\n' in summary:
printError(pkg, 'summary-on-multiple-lines', lang)

View File

@ -1,15 +1,17 @@
--- InitScriptCheck.py
+++ InitScriptCheck.py
@@ -30,6 +30,8 @@
use_deflevels = Config.getOption('UseDefaultRunlevels', 1)
@@ -29,6 +29,10 @@
use_deflevels = Config.getOption('UseDefaultRunlevels', True)
lsb_tags_regex = re.compile('^# ([\w-]+):\s*(.*?)\s*$')
lsb_cont_regex = re.compile('^#(?:\t| )(.*?)\s*$')
+insserv_regex=re.compile('^\s*sbin/insserv', re.MULTILINE)
+preun_regex=re.compile('^\s*/etc/init.d/\S+ stop', re.MULTILINE)
+preun_regex=re.compile('^\s*%stop_on_removal\s+\S+', re.MULTILINE)
+restart_on_update_regex=re.compile('^\s*%restart_on_update \S+', re.MULTILINE)
+insserv_cleanup_regex=re.compile('^\s*%insserv_cleanup', re.MULTILINE)
LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start',
'Should-Stop', 'Default-Start', 'Default-Stop',
@@ -48,6 +50,13 @@
@@ -47,6 +51,13 @@
return
initscript_list = []
@ -21,34 +23,41 @@
+ postun = pkg[rpm.RPMTAG_POSTUN] or pkg[rpm.RPMTAG_POSTUNPROG]
+
for fname, pkgfile in pkg.files().items():
if rc_regex.search(fname):
basename = os.path.basename(fname)
@@ -57,13 +66,17 @@
if dot_in_name_regex.match(basename):
printError(pkg, 'init-script-name-with-dot', fname)
- # check chkconfig call in %post and %preun
- postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
if not postin:
- printError(pkg, 'init-script-without-chkconfig-postin', fname)
+ printError(pkg, 'init-script-without-%stop_on_removal-postin', fname)
+ else:
+ if not preun_regex.search(preun):
+ printError(pkg, 'preun-without-%stop_on_removal-preun', f)
if not fname.startswith('/etc/init.d/') and \
@@ -60,18 +71,19 @@
if dot_in_name_regex.match(basename):
printError(pkg, 'init-script-name-with-dot', fname)
- # check chkconfig call in %post and %preun
- postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
- if not postin:
- printError(pkg, 'init-script-without-chkconfig-postin', fname)
- elif not chkconfig_regex.search(postin):
- printError(pkg, 'postin-without-chkconfig', fname)
- preun = pkg[rpm.RPMTAG_PREUN] or pkg[rpm.RPMTAG_PREUNPROG]
if not preun:
- printError(pkg, 'init-script-without-chkconfig-preun', fname)
- elif not chkconfig_regex.search(preun):
- printError(pkg, 'preun-without-chkconfig', fname)
+ printError(pkg, 'init-script-without-%stop_on_removal-preun', fname)
+ elif not stop_on_removal_regex.search(postin):
+ printError(pkg, 'preun-without-%%stop_on_removal-preun', fname)
+
+ if not postun:
+ printError(pkg, 'init-script-without-%insserv_cleanup-postun', f)
else:
- if not chkconfig_regex.search(postin):
- printError(pkg, 'postin-without-chkconfig', fname)
+ if not insserv_regex.search(postun):
+ printError(pkg, 'postun-without-%insserv_cleanup', f)
+ if not postun:
+ printError(pkg, 'init-script-without-%restart_on_update-postun', fname)
+ else:
+ if not restart_on_update_regex.search(postun):
+ printError(pkg, 'postun-without-%restart_on_update', fname)
+ if not insserv_cleanup_regex.search(postun):
+ printError(pkg, 'postun-without-%insserv_cleanup', fname)
preun = pkg[rpm.RPMTAG_PREUN] or pkg[rpm.RPMTAG_PREUNPROG]
if not preun:
@@ -193,10 +206,18 @@
'postin-without-chkconfig',
'''The package contains an init script but doesn't call chkconfig in its %post.''',
status_found = False
reload_found = False
@@ -202,10 +214,18 @@
'''The package contains an init script but doesn't call chkconfig in its
%post script.''',
-'init-script-without-chkconfig-preun',
+'init-script-without-%stop_on_removal-preun',
@ -64,9 +73,9 @@
+with a call to %insserv_cleanup-postun''',
+
'preun-without-chkconfig',
'''The package contains an init script but doesn't call chkconfig in its %preun.''',
@@ -254,6 +275,18 @@
'''The package contains an init script but doesn't call chkconfig in its
%preun script.''',
@@ -264,6 +284,24 @@
'init-script-non-executable',
'''The init script should have at least the execution bit set for root
in order for it to run at boot time.''',
@ -81,7 +90,13 @@
+'''The package doesn't have a %insserv_cleanup call in %postun''',
+
+'postun-without-%insserv_cleanup',
+'''The package doesn't have a %insserv_cleanup call in %postun''',
+'''The package has an init script that is inserted with insserv but
+doesn't have a %insserv_cleanup call in %postun''',
+
+'init-script-without-%restart_on_update-postun',
+''' The package has an init script but is missing the %restart_on_update
+call in %postun to automatically restart the daemon. This is optional,
+but in most cases it is wanted. Please check.'''
)
# InitScriptCheck.py ends here

View File

@ -2,7 +2,7 @@ Index: BinariesCheck.py
===================================================================
--- BinariesCheck.py.orig
+++ BinariesCheck.py
@@ -196,6 +196,7 @@ usr_lib_exception_regex = re.compile(Con
@@ -197,6 +197,7 @@ usr_lib_exception_regex = re.compile(Con
srcname_regex = re.compile('(.*?)-[0-9]')
invalid_dir_ref_regex = re.compile('/(home|tmp)(\W|$)')
ocaml_mixed_regex = re.compile('^Caml1999X0\d\d$')
@ -10,7 +10,7 @@ Index: BinariesCheck.py
def dir_base(path):
res = path_regex.search(path)
@@ -268,7 +269,7 @@ class BinariesCheck(AbstractCheck.Abstra
@@ -269,7 +270,7 @@ class BinariesCheck(AbstractCheck.Abstra
# arch dependent packages only from here on
# in /usr/share ?

View File

@ -1,6 +1,8 @@
--- MenuXDGCheck.py
Index: MenuXDGCheck.py
===================================================================
--- MenuXDGCheck.py.orig
+++ MenuXDGCheck.py
@@ -18,7 +18,7 @@
@@ -18,7 +18,7 @@ class MenuXDGCheck(AbstractCheck.Abstrac
# $ echo $XDG_DATA_DIRS/applications
# /var/lib/menu-xdg:/usr/share
AbstractCheck.AbstractFilesCheck.__init__(

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -795,7 +795,7 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -809,7 +809,7 @@ class TagsCheck(AbstractCheck.AbstractCh
printWarning(pkg, 'no-url-tag')
obs_names = [x[0] for x in pkg.obsoletes()]