- update to 1.4:

* rpmdiff: Teach rpmdiff about pretrans and posttrans
  * SpecCheck.py: merge patch from #97, using BuildArch with
  something else than Noarch is likely a error and causing issues.
  * FilesCheck.py: Add Python 3.3 magic number
  * FilesCheck.py, InitScriptCheck.py, MenuCheck.py, Pkg.py,
    PostCheck.py: Prepare for rpm-python possibly returning script
   progs as arrays.

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=133
This commit is contained in:
Dirk Mueller 2012-09-13 16:01:40 +00:00 committed by Git OBS Bridge
parent 09e89d79c3
commit 3073721c60
37 changed files with 103 additions and 86 deletions

View File

@ -2,7 +2,7 @@ Index: Pkg.py
===================================================================
--- Pkg.py.orig
+++ Pkg.py
@@ -425,6 +425,10 @@ class Pkg:
@@ -426,6 +426,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:
@@ -672,6 +676,22 @@ class Pkg:
@@ -673,6 +677,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."""
@@ -708,7 +728,7 @@ class Pkg:
@@ -709,7 +729,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]
@@ -719,7 +739,11 @@ class Pkg:
@@ -720,7 +740,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):
@@ -729,6 +753,10 @@ class Pkg:
@@ -730,6 +754,10 @@ class Pkg:
self._provides = []
self._conflicts = []
self._obsoletes = []
@ -69,9 +69,9 @@ Index: Pkg.py
self._gather_aux(self.header, self._requires,
rpm.RPMTAG_REQUIRENAME,
@@ -748,6 +776,32 @@ class Pkg:
rpm.RPMTAG_OBSOLETEFLAGS,
rpm.RPMTAG_OBSOLETEVERSION)
@@ -761,6 +789,32 @@ class Pkg:
prog = " ".join(prog)
return prog
+ try:
+ self._gather_aux(self.header, self._recommends,

View File

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

View File

@ -2,7 +2,7 @@ Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -620,7 +620,7 @@ versions you can ignore this warning.'''
@@ -631,7 +631,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

@ -2,7 +2,7 @@ Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -223,7 +223,9 @@ class SpecCheck(AbstractCheck.AbstractCh
@@ -224,7 +224,9 @@ class SpecCheck(AbstractCheck.AbstractCh
continue

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-1.2/SpecCheck.py
Index: rpmlint-1.4/SpecCheck.py
===================================================================
--- rpmlint-1.2.orig/SpecCheck.py
+++ rpmlint-1.2/SpecCheck.py
@@ -594,8 +594,8 @@ addDetails(
--- rpmlint-1.4.orig/SpecCheck.py
+++ rpmlint-1.4/SpecCheck.py
@@ -605,8 +605,8 @@ addDetails(
SPEC file to build a valid RPM package.''',
'invalid-spec-name',

View File

@ -12,7 +12,7 @@ Index: TagsCheck.py
if not pkg[rpm.RPMTAG_HEADERI18NTABLE]:
self._unexpanded_macros(pkg, '%description', description)
else:
@@ -985,6 +988,10 @@ Name tag.''',
@@ -987,6 +990,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
@@ -846,6 +846,10 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -847,6 +847,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$')
@@ -1202,7 +1203,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1204,7 +1205,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:
@@ -1574,7 +1575,10 @@ included in your package.''',
@@ -1576,7 +1577,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

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1220,7 +1220,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1222,7 +1222,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

@ -20,7 +20,7 @@ Index: TagsCheck.py
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])
@@ -1087,6 +1091,12 @@ explicit Requires: tags.''',
@@ -1089,6 +1093,12 @@ explicit Requires: tags.''',
'''This package provides 2 times the same capacity. It should only provide it
once.''',

View File

@ -1,6 +1,8 @@
--- BinariesCheck.py
Index: BinariesCheck.py
===================================================================
--- BinariesCheck.py.orig
+++ BinariesCheck.py
@@ -231,8 +231,19 @@
@@ -253,8 +253,19 @@ class BinariesCheck(AbstractCheck.Abstra
is_elf = 'ELF' in pkgfile.magic
is_ar = 'current ar archive' in pkgfile.magic
is_ocaml_native = 'Objective caml native' in pkgfile.magic
@ -20,7 +22,7 @@
if not is_binary:
if reference_regex.search(fname):
lines = pkg.grep(invalid_dir_ref_regex, fname)
@@ -463,6 +474,15 @@
@@ -502,6 +513,15 @@ recompiled separately from the static li
Another common mistake that causes this problem is linking with
``gcc -Wl,-shared'' instead of ``gcc -shared''.''',

View File

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

View File

@ -2,7 +2,7 @@ Index: BinariesCheck.py
===================================================================
--- BinariesCheck.py.orig
+++ BinariesCheck.py
@@ -232,6 +232,7 @@ class BinariesCheck(AbstractCheck.Abstra
@@ -234,6 +234,7 @@ class BinariesCheck(AbstractCheck.Abstra
binary = False
binary_in_usr_lib = False
has_usr_lib_file = False
@ -10,7 +10,7 @@ Index: BinariesCheck.py
multi_pkg = False
res = srcname_regex.search(pkg[rpm.RPMTAG_SOURCERPM] or '')
@@ -248,6 +249,10 @@ class BinariesCheck(AbstractCheck.Abstra
@@ -250,6 +251,10 @@ class BinariesCheck(AbstractCheck.Abstra
# only-non-binary-in-usr-lib false positives
binary_in_usr_lib = True
@ -21,7 +21,7 @@ Index: BinariesCheck.py
is_elf = 'ELF' in pkgfile.magic
is_ar = 'current ar archive' in pkgfile.magic
is_ocaml_native = 'Objective caml native' in pkgfile.magic
@@ -442,9 +447,12 @@ class BinariesCheck(AbstractCheck.Abstra
@@ -464,9 +469,12 @@ class BinariesCheck(AbstractCheck.Abstra
if version and version != -1 and version not in pkg.name:
printError(pkg, 'incoherent-version-in-name', version)
@ -35,7 +35,7 @@ Index: BinariesCheck.py
if has_usr_lib_file and not binary_in_usr_lib:
printWarning(pkg, 'only-non-binary-in-usr-lib')
@@ -468,6 +476,11 @@ FHS and the FSSTND forbid this.''',
@@ -490,6 +498,11 @@ FHS and the FSSTND forbid this.''',
# 'non-sparc32-binary',
# '',

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)
@@ -63,6 +63,9 @@ class InitScriptCheck(AbstractCheck.Abst
@@ -64,6 +64,9 @@ class InitScriptCheck(AbstractCheck.Abst
not fname.startswith('/etc/rc.d/init.d/'):
continue

View File

@ -24,7 +24,7 @@ Index: TagsCheck.py
_enchant_checkers = {}
def spell_check(pkg, str, fmt, lang, ignored):
@@ -854,30 +845,12 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -856,30 +847,12 @@ class TagsCheck(AbstractCheck.AbstractCh
(apply(Pkg.formatRequire, obs),
apply(Pkg.formatRequire, prov)))

View File

@ -11,7 +11,7 @@ Index: TagsCheck.py
elif VALID_GROUPS and group not in VALID_GROUPS:
printWarning(pkg, 'non-standard-group', group)
@@ -1024,6 +1026,10 @@ won't fool the specfile parser, and rebu
@@ -1026,6 +1028,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:46ca95b4af224a5923739b6eed8224f18235913136e5004838e5312b4bada0f7
size 115772

3
rpmlint-1.4.tar.xz Normal file
View File

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

View File

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

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Thu Sep 13 16:00:07 UTC 2012 - dmueller@suse.com
- update to 1.4:
* rpmdiff: Teach rpmdiff about pretrans and posttrans
* SpecCheck.py: merge patch from #97, using BuildArch with
something else than Noarch is likely a error and causing issues.
* FilesCheck.py: Add Python 3.3 magic number
* FilesCheck.py, InitScriptCheck.py, MenuCheck.py, Pkg.py,
PostCheck.py: Prepare for rpm-python possibly returning script
progs as arrays.
-------------------------------------------------------------------
Fri Aug 3 17:22:43 UTC 2012 - thardeck@suse.com

View File

@ -25,7 +25,7 @@ BuildRequires: xz
Summary: Rpm correctness checker
License: GPL-2.0+
Group: System/Packages
Version: 1.3
Version: 1.4
Release: 0
Source0: http://rpmlint.zarb.org/download/rpmlint-%{version}.tar.xz
Source1: config

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1252,7 +1252,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1254,7 +1254,7 @@ class FilesCheck(AbstractCheck.AbstractC
elif interpreter or mode & 0111 != 0 or \
script_regex.search(f):
if interpreter:

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1275,7 +1275,8 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1277,7 +1277,8 @@ class FilesCheck(AbstractCheck.AbstractC
f.endswith('.la')):
printError(pkg, 'script-without-shebang', f)

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -1022,8 +1022,8 @@ Development/''',
@@ -1024,8 +1024,8 @@ Development/''',
"%s".''' % '", "'.join(VALID_GROUPS),
'no-changelogname-tag',

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -952,6 +952,16 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -953,6 +953,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:
@@ -1760,6 +1770,24 @@ consequences), or other compiler flags w
@@ -1762,6 +1772,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
@@ -104,11 +104,23 @@
@@ -103,11 +103,23 @@ def getOption(name, default = ""):
_filters = []
_filters_re = None
@ -26,7 +28,7 @@
def removeFilter(s):
global _filters_re
@@ -123,19 +135,38 @@
@@ -122,19 +134,38 @@ def removeFilter(s):
_scoring = {}
def setBadness(s, score):
@ -69,7 +71,7 @@
_filters_re = '(?:' + _filters[0] + ')'
for idx in range(1, len(_filters)):
@@ -147,9 +178,27 @@
@@ -146,9 +177,27 @@ def isFiltered(s):
_filters_re = _filters_re + '|(?:' + _filters[idx] +')'
_filters_re = re.compile(_filters_re)

View File

@ -2,7 +2,7 @@ Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -403,6 +403,10 @@ class SpecCheck(AbstractCheck.AbstractCh
@@ -414,6 +414,10 @@ class SpecCheck(AbstractCheck.AbstractCh
printWarning(pkg, 'comparison-operator-in-deptoken',
conf)
@ -13,7 +13,7 @@ Index: SpecCheck.py
if current_section == 'changelog':
for match in AbstractCheck.macro_regex.findall(line):
res = re.match('%+', match)
@@ -716,6 +720,14 @@ may break short circuit builds.''',
@@ -732,6 +736,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

@ -40,7 +40,7 @@ Index: TagsCheck.py
# List of words to ignore in spell check
ignored_words = set()
for pf in pkg.files():
@@ -1106,6 +1118,11 @@ instead or require a file in bin or /etc
@@ -1108,6 +1120,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.''',

View File

@ -1,6 +1,8 @@
--- FilesCheck.py
Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -664,8 +664,11 @@
@@ -1153,8 +1153,11 @@ class FilesCheck(AbstractCheck.AbstractC
if res and not (pkg.check_versioned_dep('python-base',
res.group(1)) or
pkg.check_versioned_dep('python',

View File

@ -2,7 +2,7 @@ Index: InitScriptCheck.py
===================================================================
--- InitScriptCheck.py.orig
+++ InitScriptCheck.py
@@ -52,7 +52,7 @@ class InitScriptCheck(AbstractCheck.Abst
@@ -51,7 +51,7 @@ class InitScriptCheck(AbstractCheck.Abst
return
initscript_list = []
@ -10,8 +10,8 @@ Index: InitScriptCheck.py
+ rclinks = set()
# check chkconfig call in %post and %preun
postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
@@ -61,6 +61,10 @@ class InitScriptCheck(AbstractCheck.Abst
postin = pkg[rpm.RPMTAG_POSTIN] or pkg.scriptprog(pkg[rpm.RPMTAG_POSTINPROG])
@@ -60,6 +60,10 @@ class InitScriptCheck(AbstractCheck.Abst
for fname, pkgfile in pkg.files().items():
@ -22,7 +22,7 @@ Index: InitScriptCheck.py
if not fname.startswith('/etc/init.d/') and \
not fname.startswith('/etc/rc.d/init.d/'):
continue
@@ -198,6 +202,12 @@ class InitScriptCheck(AbstractCheck.Abst
@@ -199,6 +203,12 @@ class InitScriptCheck(AbstractCheck.Abst
elif subsys_regex_found and not use_subsys:
printError(pkg, 'subsys-unsupported', fname)
@ -32,10 +32,10 @@ Index: InitScriptCheck.py
+ 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],
@@ -220,6 +230,10 @@ a call to chkconfig.''',
if len(initscript_list) == 1:
pkgname = re.sub("-sysvinit$", "", pkg.name.lower())
goodnames = (pkgname, pkgname + 'd')
@@ -223,6 +233,10 @@ a call to chkconfig.''',
'''The package contains an init script but doesn't contain a %preun with
a call to chkconfig.''',

View File

@ -2,7 +2,7 @@ Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -598,8 +598,8 @@ SPEC file to build a valid RPM package.'
@@ -609,8 +609,8 @@ SPEC file to build a valid RPM package.'
("Name:" tag). Either rename your package or the specfile.''',
'non-utf8-spec-file',

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -778,7 +778,7 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -780,7 +780,7 @@ class TagsCheck(AbstractCheck.AbstractCh
if not valid_license:
self._unexpanded_macros(pkg, 'License', rpm_license)
@ -11,7 +11,7 @@ Index: TagsCheck.py
if hasattr(rpm, 'RPMTAG_%s' % tag.upper()):
url = pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())]
self._unexpanded_macros(pkg, tag, url, is_url = True)
@@ -1094,7 +1094,7 @@ once.''',
@@ -1096,7 +1096,7 @@ once.''',
'''This rpm requires a specific release of another package.''',
'no-url-tag',

View File

@ -1,8 +1,6 @@
Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
--- SpecCheck.py
+++ SpecCheck.py
@@ -56,6 +56,7 @@ libdir_regex = re.compile('%{?_lib(?:dir
@@ -57,6 +57,7 @@
comment_or_empty_regex = re.compile('^\s*(#|$)')
defattr_regex = re.compile('^\s*%defattr\\b')
attr_regex = re.compile('^\s*%attr\\b')
@ -10,9 +8,9 @@ Index: SpecCheck.py
section_regexs = dict(
([x, re.compile('^%' + x + '(?:\s|$)')]
for x in ('build', 'changelog', 'check', 'clean', 'description', 'files',
@@ -348,6 +349,12 @@ class SpecCheck(AbstractCheck.AbstractCh
if res:
package_noarch[current_package] = True
@@ -359,6 +360,12 @@
if not res.group(1).startswith('%'):
printWarning(pkg, 'hardcoded-prefix-tag', res.group(1))
+ res = suse_version_regex.search(line)
+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1130:
@ -23,7 +21,7 @@ Index: SpecCheck.py
res = prereq_regex.search(line)
if res:
printError(pkg, 'prereq-use', res.group(2))
@@ -758,6 +765,15 @@ in the resulting binary package dependin
@@ -774,6 +781,15 @@
version (typically < 4.4). Add default attributes using %defattr before it in
the %files section, or use per entry %attr's.''',

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -881,7 +881,7 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -883,7 +883,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

@ -2,7 +2,7 @@ Index: InitScriptCheck.py
===================================================================
--- InitScriptCheck.py.orig
+++ InitScriptCheck.py
@@ -31,6 +31,10 @@ lsb_tags_regex = re.compile('^# ([\w-]+)
@@ -30,6 +30,10 @@ lsb_tags_regex = re.compile('^# ([\w-]+)
lsb_cont_regex = re.compile('^#(?:\t| )(.*?)\s*$')
use_subsys = Config.getOption('UseVarLockSubsys', True)
@ -13,37 +13,38 @@ Index: InitScriptCheck.py
LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start',
'Should-Stop', 'Default-Start', 'Default-Stop',
'Short-Description', 'Description')
@@ -48,6 +52,13 @@ class InitScriptCheck(AbstractCheck.Abst
@@ -47,6 +51,13 @@ class InitScriptCheck(AbstractCheck.Abst
return
initscript_list = []
+
+
+ # check chkconfig call in %post and %preun
+ postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG]
+ preun = pkg[rpm.RPMTAG_PREUN] or pkg[rpm.RPMTAG_PREUNPROG]
+ postun = pkg[rpm.RPMTAG_POSTUN] or pkg[rpm.RPMTAG_POSTUNPROG]
+ postin = pkg[rpm.RPMTAG_POSTIN] or pkg.scriptprog(pkg[rpm.RPMTAG_POSTINPROG])
+ preun = pkg[rpm.RPMTAG_PREUN] or pkg.scriptprog(pkg[rpm.RPMTAG_PREUNPROG])
+ postun = pkg[rpm.RPMTAG_POSTUN] or pkg.scriptprog(pkg[rpm.RPMTAG_POSTUNPROG])
+
for fname, pkgfile in pkg.files().items():
if not fname.startswith('/etc/init.d/') and \
@@ -61,18 +72,15 @@ class InitScriptCheck(AbstractCheck.Abst
if dot_in_name_regex.match(basename):
@@ -61,20 +72,16 @@ class InitScriptCheck(AbstractCheck.Abst
if "." in 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]
- postin = pkg[rpm.RPMTAG_POSTIN] or \
- pkg.scriptprog(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]
preun = pkg[rpm.RPMTAG_PREUN] or \
pkg.scriptprog(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)
+
+ if not preun or not stop_on_removal_regex.search(preun):
+ printError(pkg, 'init-script-without-%stop_on_removal-preun', fname)
+
@ -55,7 +56,7 @@ Index: InitScriptCheck.py
status_found = False
reload_found = False
@@ -271,6 +279,17 @@ of chkconfig don't work as expected with
@@ -275,6 +282,17 @@ of chkconfig don't work as expected with
'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.''',

View File

@ -2,7 +2,7 @@ Index: BinariesCheck.py
===================================================================
--- BinariesCheck.py.orig
+++ BinariesCheck.py
@@ -206,6 +206,7 @@ usr_lib_exception_regex = re.compile(Con
@@ -208,6 +208,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)
@@ -278,7 +279,7 @@ class BinariesCheck(AbstractCheck.Abstra
@@ -280,7 +281,7 @@ class BinariesCheck(AbstractCheck.Abstra
# arch dependent packages only from here on
# in /usr/share ?

View File

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