SHA256
1
0
forked from pool/rpmlint

- new versioin 1.6

- add script update_git.sh based on qemu's to simplify importing
  a patch series from git after rebasing.
* Patches dropped:
  0001-Python-3-compatibility-tweaks.patch (upstream)
  0001-Set-Python-3.4-magic-number-to-3310.patch (upstream)
  add-scoring-support.diff (different upstream solution)
  check-buildroot-during-install.diff (need to fix no-cleaning-of-buildroot check upstream)
  fix-versioned-prereq.diff (was disabled, not sure what it's useful for)
  ignore-non-readable-in-etc.diff (filtered anyways)
  locale-support.diff (drop)
  locale-update.diff (different upstream solution now)
  more-verbose-lsb-check.diff (drop)
  perl-versioned-rpath-deps.diff (upstream)
  rpmlint-1.5-disallow-var-run-and-var-lock.diff (upstream)
  rpmlint-1.5-Fix-setgroups-error-name.diff (upstream)
  rpmlint-decode-fix.diff (different upstream solution)
  rpmlint-fix-unexpanded-macros-for-array-values.patch (different upstream solution)
  stricter-tags-check.diff (merged in weak deps and check-for-self-provides.diff)
  suppress-for-perl-python.diff (use filter instead)
  suse-binary-info-compile-opts.diff (drop)
  suse-changelog.patch (change config instead)
  suse-mono-deps-checks.diff (useful?)
  suse-required-lsb-tags.diff (different upstream solution)
  verify-buildrequires.diff (very build system specific, drop)
  xdg-check-exception.diff (upstream)
* renamed patches:
  script-interpreter-only-for-exec-scripts.diff
  -> script-interpreter-only-for-exec-sc.diff
  confusing-invalid-spec-name.patch

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=317
This commit is contained in:
Ludwig Nussel 2015-04-10 14:35:46 +00:00 committed by Git OBS Bridge
parent c9ee2d5aa1
commit bda5d592a2
75 changed files with 1068 additions and 1480 deletions

View File

@ -1,40 +0,0 @@
--- Filter.py
+++ Filter.py
@@ -80,23 +80,24 @@
def _diag_compare(x, y):
- where_a = x.split()[1]
- level_a = x.split()[2]
+ where_a = x.split()[2]
+ level_a = x.split()[1]
- where_b = y.split()[1]
- level_b = y.split()[2]
+ where_b = y.split()[2]
+ level_b = y.split()[1]
- if level_b > level_a:
+ if (level_b > level_a):
return 1
- elif level_b == level_a:
- if where_b > where_b:
- return 1
- elif where_b == where_a:
- return 0
- else:
- return -1
- else:
+
+ if (level_b < level_a):
+ return -1
+
+ if (where_b < where_a):
+ return 1
+
+ if (where_b > where_a):
return -1
+ return 0
def printAllReasons():

View File

@ -1,8 +1,19 @@
Index: Pkg.py From 8cacb89fedba57086f1e02d326308142e6d70dbe Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] add-weak-dependencies.diff
=================================================================== ===================================================================
--- Pkg.py.orig 2014-02-21 15:11:27.194647274 +0000 ---
+++ Pkg.py 2014-02-21 15:13:26.205647064 +0000 Pkg.py | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
@@ -427,6 +427,10 @@ class Pkg: TagsCheck.py | 19 +++++++++++++++++++
2 files changed, 70 insertions(+), 2 deletions(-)
diff --git a/Pkg.py b/Pkg.py
index e97d7ef..cfaa5a9 100644
--- a/Pkg.py
+++ b/Pkg.py
@@ -466,6 +466,10 @@ class Pkg:
self._missingok_files = None self._missingok_files = None
self._files = None self._files = None
self._requires = None self._requires = None
@ -13,7 +24,7 @@ Index: Pkg.py
self._req_names = -1 self._req_names = -1
if header: if header:
@@ -673,6 +677,22 @@ class Pkg: @@ -716,6 +720,22 @@ class Pkg:
self._gatherDepInfo() self._gatherDepInfo()
return self._requires return self._requires
@ -36,17 +47,17 @@ Index: Pkg.py
def prereq(self): def prereq(self):
"""Get package PreReqs as list of """Get package PreReqs as list of
(name, flags, (epoch, version, release)) tuples.""" (name, flags, (epoch, version, release)) tuples."""
@@ -709,7 +729,7 @@ class Pkg: @@ -752,7 +772,7 @@ class Pkg:
# internal function to gather dependency info used by the above ones # internal function to gather dependency info used by the above ones
def _gather_aux(self, header, list, nametag, flagstag, versiontag, def _gather_aux(self, header, list, nametag, flagstag, versiontag,
- prereq = None): - prereq=None):
+ prereq = None, strong_only = False, weak_only = False): + prereq = None, strong_only = False, weak_only = False):
names = header[nametag] names = header[nametag]
flags = header[flagstag] flags = header[flagstag]
versions = header[versiontag] versions = header[versiontag]
@@ -720,7 +740,11 @@ class Pkg: @@ -763,7 +783,11 @@ class Pkg:
evr = stringToVersion(versions[loop].decode()) evr = stringToVersion(b2s(versions[loop]))
if prereq is not None and flags[loop] & PREREQ_FLAG: if prereq is not None and flags[loop] & PREREQ_FLAG:
prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr)) prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr))
- else: - else:
@ -58,7 +69,7 @@ Index: Pkg.py
list.append((name, flags[loop], evr)) list.append((name, flags[loop], evr))
def _gatherDepInfo(self): def _gatherDepInfo(self):
@@ -730,6 +754,10 @@ class Pkg: @@ -773,6 +797,10 @@ class Pkg:
self._provides = [] self._provides = []
self._conflicts = [] self._conflicts = []
self._obsoletes = [] self._obsoletes = []
@ -69,7 +80,7 @@ Index: Pkg.py
self._gather_aux(self.header, self._requires, self._gather_aux(self.header, self._requires,
rpm.RPMTAG_REQUIRENAME, rpm.RPMTAG_REQUIRENAME,
@@ -748,6 +776,26 @@ class Pkg: @@ -791,6 +819,26 @@ class Pkg:
rpm.RPMTAG_OBSOLETENAME, rpm.RPMTAG_OBSOLETENAME,
rpm.RPMTAG_OBSOLETEFLAGS, rpm.RPMTAG_OBSOLETEFLAGS,
rpm.RPMTAG_OBSOLETEVERSION) rpm.RPMTAG_OBSOLETEVERSION)
@ -96,11 +107,43 @@ Index: Pkg.py
def scriptprog(self, which): def scriptprog(self, which):
"""Get the specified script interpreter as a string. """Get the specified script interpreter as a string.
@@ -761,6 +809,7 @@ class Pkg: @@ -805,6 +853,7 @@ class Pkg:
prog = " ".join(prog) return b2s(prog)
return prog
+ +
def getInstalledPkgs(name): def getInstalledPkgs(name):
"""Get list of installed package objects by name.""" """Get list of installed package objects by name."""
diff --git a/TagsCheck.py b/TagsCheck.py
index bc79283..6528d5b 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -853,8 +853,27 @@ class TagsCheck(AbstractCheck.AbstractCheck):
value = Pkg.formatRequire(*c)
self._unexpanded_macros(pkg, 'Conflicts %s' % (value,), value)
+ for i in pkg.supplements():
+ value = Pkg.formatRequire(*i)
+ self._unexpanded_macros(pkg, 'Supplements %s' % (value,), value)
+
+ for i in pkg.suggests():
+ value = Pkg.formatRequire(*i)
+ self._unexpanded_macros(pkg, 'Suggests %s' % (value,), value)
+
+ for i in pkg.enhances():
+ value = Pkg.formatRequire(*i)
+ self._unexpanded_macros(pkg, 'Enhances %s' % (value,), value)
+
+ for i in pkg.recommends():
+ value = Pkg.formatRequire(*i)
+ self._unexpanded_macros(pkg, 'Recommends %s' % (value,), value)
+
obss = pkg.obsoletes()
if obss:
+ for obs in obss:
+ value = Pkg.formatRequire(*obs)
+ self._unexpanded_macros(pkg, 'Obsoletes %s' % (value,), value)
provs = pkg.provides()
for prov in provs:
for obs in obss:

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From 386f6785bc98ee54066a85c302774c194df2510c Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] avoid-mismatched-libregex.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 2 +-
@@ -607,7 +607,7 @@ buildconfig_rpath_regex = re.compile('(? 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index efda328..14cfca3 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -615,7 +615,7 @@ buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b')
sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$') sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$')
devel_regex = re.compile('(.*)-(debug(info)?|devel|headers|source|static)$') devel_regex = re.compile('(.*)-(debug(info)?|devel|headers|source|static)$')
debuginfo_package_regex = re.compile('-debug(info)?$') debuginfo_package_regex = re.compile('-debug(info)?$')

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From e89c19e2d11128280b9fc14289f69c1d785457ff Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] better-wrong-script.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 5 ++++-
@@ -1670,7 +1670,10 @@ executed.''', 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 7504167..72bdf54 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -1657,7 +1657,10 @@ executed.''',
executed.''', executed.''',
'wrong-script-interpreter', 'wrong-script-interpreter',

View File

@ -1,8 +1,18 @@
Index: SpecCheck.py From b0926d6684098407592ef15e24dc83958afe4a38 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] buildroot-doc.diff
=================================================================== ===================================================================
--- SpecCheck.py.orig ---
+++ SpecCheck.py SpecCheck.py | 2 +-
@@ -647,7 +647,7 @@ versions you can ignore this warning.''' 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SpecCheck.py b/SpecCheck.py
index 9ea5c6e..dde66fc 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -672,7 +672,7 @@ versions you can ignore this warning.''',
'hardcoded-path-in-buildroot-tag', 'hardcoded-path-in-buildroot-tag',
'''A path is hardcoded in your Buildroot tag. It should be replaced '''A path is hardcoded in your Buildroot tag. It should be replaced

View File

@ -1,8 +1,18 @@
Index: SpecCheck.py From ab1b397c298c733da39c611938be99c457a0fa9a Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] buildroot-in-scripts.diff
=================================================================== ===================================================================
--- SpecCheck.py.orig ---
+++ SpecCheck.py SpecCheck.py | 4 +++-
@@ -234,7 +234,9 @@ class SpecCheck(AbstractCheck.AbstractCh 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/SpecCheck.py b/SpecCheck.py
index dde66fc..63897f2 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -238,7 +238,9 @@ class SpecCheck(AbstractCheck.AbstractCheck):
continue continue

View File

@ -1,74 +0,0 @@
Index: SpecCheck.py
===================================================================
--- SpecCheck.py.orig
+++ SpecCheck.py
@@ -34,7 +34,7 @@ prefix_regex = re.compile('^Prefix\s*:\s
packager_regex = re.compile('^Packager\s*:\s*([^\s]+)', re.IGNORECASE)
noarch_regex = re.compile('^BuildArch(?:itectures)?\s*:\s*\\bnoarch\\b', re.IGNORECASE)
make_check_regex = re.compile('(^|\s|%{?__)make}?\s+(check|test)')
-rm_regex = re.compile('(^|\s)((.*/)?rm|%{?__rm}?) ')
+rm_rf_regex = re.compile('(^|\s)((.*/)?rm|%{?__rm}?) -[fF]?[rR][^/]*$')
rpm_buildroot_regex = re.compile('(\\\*)\${?RPM_BUILD_ROOT}?|(%+){?buildroot}?')
configure_start_regex = re.compile('\./configure')
configure_libdir_spec_regex = re.compile('ln |\./configure[^#]*--libdir=([^\s]+)[^#]*')
@@ -145,6 +145,14 @@ def contains_buildroot(line):
return 0
+def contains_create_buildroot(line):
+ '''Check if the line is of the form mkdir %{buildroot}.'''
+ line = line.strip()
+ if contains_buildroot(line) and line.startswith("mkdir") and \
+ not line.count("-p"):
+ return True
+ return False
+
class SpecCheck(AbstractCheck.AbstractCheck):
def __init__(self):
@@ -192,6 +200,7 @@ class SpecCheck(AbstractCheck.AbstractCh
ifarch_depth = -1
current_section = 'package'
buildroot_clean = {'clean': 0, 'install' : 0}
+ buildroot_created={'clean':False , 'install':True}
depscript_override = 0
depgen_disabled = 0
indent_spaces = 0
@@ -261,8 +270,13 @@ class SpecCheck(AbstractCheck.AbstractCh
printWarning(pkg, 'make-check-outside-check-section', line[:-1])
if current_section in buildroot_clean:
- if contains_buildroot(line) and rm_regex.search(line):
+ if buildroot_created[current_section] and \
+ contains_buildroot(line) and rm_rf_regex.search(line):
buildroot_clean[current_section] = 1
+ buildroot_created[current_section] = False
+
+ if contains_create_buildroot(line):
+ buildroot_created[current_section] = True
if ifarch_regex.search(line):
if_depth = if_depth + 1
@@ -441,6 +455,9 @@ class SpecCheck(AbstractCheck.AbstractCh
if not buildroot_clean[sect]:
printError(pkg, 'no-cleaning-of-buildroot', '%' + sect)
+ if buildroot_clean['install'] and not buildroot_created['install']:
+ printError(pkg, '%install-no-mkdir-buildroot')
+
if not buildroot:
printError(pkg, 'no-buildroot-tag')
@@ -598,6 +615,12 @@ unpacking the sources.''',
'''You should clean $RPM_BUILD_ROOT in the %clean section and just after the
beginning of %install section. Use "rm -Rf $RPM_BUILD_ROOT".''',
+'%install-no-mkdir-buildroot',
+"""Your install section removes the buildroot but does not create them
+afterwards in a secure way, which allows attackers to trivially play tricks
+with symlinks on you. use mkdir %buildroot (no -p option!) or don't clean
+the buildroot in %install, because that's anyway already done for you by rpm.""",
+
'rpm-buildroot-usage',
'''$RPM_BUILD_ROOT should not be touched during %build or %prep stage, as it
will break short circuiting.''',

View File

@ -0,0 +1,33 @@
From 37d58a8f4b2b3183354949ce39de151b5d449d9b Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Fri, 10 Apr 2015 14:54:18 +0200
Subject: [PATCH] check for self provides
---
TagsCheck.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/TagsCheck.py b/TagsCheck.py
index 4141bbc..fa6154c 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -846,6 +846,8 @@ class TagsCheck(AbstractCheck.AbstractCheck):
for p in pkg.provides():
value = Pkg.formatRequire(*p)
self._unexpanded_macros(pkg, 'Provides %s' % (value,), value)
+ if p[0] == pkg.name and not p[1]:
+ printError(pkg, 'unversioned-explicit-self-provides', p[0])
for c in pkg.conflicts():
value = Pkg.formatRequire(*c)
@@ -1180,6 +1182,10 @@ objects should thus not be depended on and they should not result in provides
in the containing package. Get rid of the provides if appropriate, for example
by filtering it out during build. Note that in some cases this may require
disabling rpmbuild's internal dependency generator.''',
+
+'unversioned-explicit-self-provides',
+'''This package provides it's own name explicitely, which might break
+upgrade path. self-provides are autogenerated. Remove the provide.''',
)
# TagsCheck.py ends here

View File

@ -1,10 +1,20 @@
Index: FilesCheck.py From 70e38f94218a96edac50b512807a2cd42f4de187 Mon Sep 17 00:00:00 2001
=================================================================== From: Some One <nobody@opensuse.org>
--- FilesCheck.py.orig Date: Thu, 9 Apr 2015 14:55:40 +0200
+++ FilesCheck.py Subject: [PATCH] compressed-backup-regex.diff
@@ -591,7 +591,7 @@ DEFAULT_STANDARD_GROUPS = ('root', 'bin'
===================================================================
---
FilesCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index fc44b50..acb379f 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -599,7 +599,7 @@ DEFAULT_DISALLOWED_DIRS = (
)
tmp_regex = re.compile('^(/var|/usr)?/tmp/')
sub_bin_regex = re.compile('^(/usr)?/s?bin/\S+/') sub_bin_regex = re.compile('^(/usr)?/s?bin/\S+/')
-backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.rej)$') -backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.rej)$')
+backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.orig\.gz|\.rej)$') +backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.orig\.gz|\.rej)$')

3
config
View File

@ -397,6 +397,9 @@ add the user to the "config" file and send a submitrequest.
To register the group, please branch the devel:openSUSE:Factory:rpmlint rpmlint package, To register the group, please branch the devel:openSUSE:Factory:rpmlint rpmlint package,
add the group to the "config" file and send a submitrequest. add the group to the "config" file and send a submitrequest.
''' '''
'no-changelogname-tag',
'''There is no changelog. Please insert a '%changelog' section heading in your
spec file and prepare your changes file using e.g. the 'osc vc' command.''',
) )
setOption('DanglingSymlinkExceptions', setOption('DanglingSymlinkExceptions',

View File

@ -0,0 +1,26 @@
From f4d4e6259fe2cec6b7d111ff3fde6be3043eeda8 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] confusing-invalid-spec-name
# 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.
---
SpecCheck.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/SpecCheck.py b/SpecCheck.py
index 12b6f2b..d0d381a 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -646,8 +646,8 @@ addDetails(
SPEC file to build a valid RPM package.''',
'invalid-spec-name',
-'''Your spec filename must end with '.spec'. If it's not the case, rename your
-file and rebuild your package.''',
+'''The spec file name (without the .spec suffix) must match the package name
+("Name:" tag). Either rename your package or the specfile.''',
'non-utf8-spec-file',
'''The character encoding of the spec file is not UTF-8. Convert it for

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From 7209e0c7b0d04b939753c654ca17261be41b448b Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] description-check.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 7 +++++++
@@ -715,6 +715,9 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 7 insertions(+)
diff --git a/TagsCheck.py b/TagsCheck.py
index b1c4c7a..bc79283 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -716,6 +716,9 @@ class TagsCheck(AbstractCheck.AbstractCheck):
else: else:
for lang in langs: for lang in langs:
self.check_description(pkg, lang, ignored_words) self.check_description(pkg, lang, ignored_words)
@ -12,7 +22,7 @@ Index: TagsCheck.py
else: else:
printError(pkg, 'no-description-tag') printError(pkg, 'no-description-tag')
@@ -995,6 +998,10 @@ Name tag.''', @@ -997,6 +1000,10 @@ Name tag.''',
'''The major number of the library isn't included in the package's name. '''The major number of the library isn't included in the package's name.
''', ''',

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From f22bf06e92c4e092b0dd71cae0bf72dcfae4de96 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] devel-provide-is-devel-package.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 4 ++++
@@ -807,6 +807,10 @@ class FilesCheck(AbstractCheck.AbstractC 1 file changed, 4 insertions(+)
diff --git a/FilesCheck.py b/FilesCheck.py
index 72bdf54..ae9c364 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -829,6 +829,10 @@ class FilesCheck(AbstractCheck.AbstractCheck):
# Check if the package is a development package # Check if the package is a development package
devel_pkg = devel_regex.search(pkg.name) devel_pkg = devel_regex.search(pkg.name)

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From 0375b024b39aabdb7d237d95c3163244f2f147ca Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] docdata-examples.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 8 ++++++--
@@ -601,6 +601,7 @@ bin_regex = re.compile('^/(?:usr/(?:s?bi 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index c485125..7504167 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -609,6 +609,7 @@ bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)')
includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE)
develfile_regex = re.compile('\.(a|cmxa?|mli?)$') develfile_regex = re.compile('\.(a|cmxa?|mli?)$')
buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$') buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$')
@ -10,7 +20,7 @@ Index: FilesCheck.py
# room for improvement with catching more -R, but also for false positives... # room for improvement with catching more -R, but also for false positives...
buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b') buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b')
sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$') sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$')
@@ -1158,7 +1159,7 @@ class FilesCheck(AbstractCheck.AbstractC @@ -1181,7 +1182,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
includefile_regex.search(f) or \ includefile_regex.search(f) or \
develfile_regex.search(f) or \ develfile_regex.search(f) or \
logrotate_regex.search(f) logrotate_regex.search(f)
@ -19,7 +29,7 @@ Index: FilesCheck.py
printWarning(pkg, 'spurious-executable-perm', f) printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \ elif f.startswith('/etc/') and f not in config_files and \
f not in ghost_files: f not in ghost_files:
@@ -1541,7 +1542,10 @@ included in your package.''', @@ -1534,7 +1535,10 @@ included in your package.''',
'spurious-executable-perm', 'spurious-executable-perm',
'''The file is installed with executable permissions, but was identified as one '''The file is installed with executable permissions, but was identified as one
that probably should not be executable. Verify if the executable bits are that probably should not be executable. Verify if the executable bits are

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From 142dd63355795f86a26db29fc20917b19b57d62a Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] extend-suse-conffiles-check.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 2 +-
@@ -1179,7 +1179,7 @@ class FilesCheck(AbstractCheck.AbstractC 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 0bb4b3d..fc44b50 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -1199,7 +1199,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
if nonexec_file and not docdir_examples_regex.search(f): if nonexec_file and not docdir_examples_regex.search(f):
printWarning(pkg, 'spurious-executable-perm', f) printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \ elif f.startswith('/etc/') and f not in config_files and \

View File

@ -1,10 +1,20 @@
Index: Filter.py From 650e2106a909706246d910463d52a59dfa75b2f4 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] filename-non-utf8-exception.diff
=================================================================== ===================================================================
--- Filter.py.orig ---
+++ Filter.py Filter.py | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/Filter.py b/Filter.py
index 40fbf79..37ba038 100644
--- a/Filter.py
+++ b/Filter.py
@@ -23,14 +23,8 @@ _diagnostic = list() @@ -23,14 +23,8 @@ _diagnostic = list()
_badness_score = 0 _badness_score = 0
printed_messages = { "I": 0, "W": 0, "E": 0 } printed_messages = {"I": 0, "W": 0, "E": 0}
-if sys.stdout.isatty(): -if sys.stdout.isatty():
- def __print(s): - def __print(s):
@ -17,5 +27,5 @@ Index: Filter.py
+def __print(s): +def __print(s):
+ print(s) + print(s)
def printInfo(pkg, reason, *details): def printInfo(pkg, reason, *details):
_print("I", pkg, reason, details)

View File

@ -1,26 +0,0 @@
--- Pkg.py
+++ Pkg.py
@@ -403,10 +403,19 @@
current_version=d[1]
if current_version.find(':') > 0:
current_version=''.join(current_version.split(':')[1:])
- if d[2] & rpm.RPMSENSE_EQUAL != rpm.RPMSENSE_EQUAL or current_version != version:
- return 0
- else:
- return 1
+
+ if d[2] & rpm.RPMSENSE_EQUAL:
+ if current_version == version:
+ return 1
+
+ if d[2] & rpm.RPMSENSE_GREATER:
+ if current_version.count('.') > version.count('.'):
+ current_version = '.'.join(current_version.split('.')[0:version.count('.')])
+
+ if current_version == version:
+ return 1
+
+ return 0
return 0
def conflicts(self):

View File

@ -1,14 +0,0 @@
Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -980,7 +980,8 @@ class FilesCheck(AbstractCheck.AbstractC
(includefile_regex.search(f) or \
develfile_regex.search(f) or is_buildconfig):
printWarning(pkg, 'devel-file-in-non-devel-package', f)
- if mode & 0444 != 0444 and perm & 07000 == 0 and f[0:len('/var/log')] != '/var/log':
+ if mode & 0444 != 0444 and perm & 07000 == 0 and \
+ not f.startswith('/var/log/') and not f.startswith('/etc/'):
printError(pkg, 'non-readable', f, oct(perm))
if size == 0 and not normal_zero_length_regex.search(f) and f not in ghost_files:
printError(pkg, 'zero-length', f)

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From 7f031242ba0f3d31440bf5c0ecdcd6915c0ffab1 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] invalid-filerequires.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 10 ++++++++++
@@ -421,6 +421,7 @@ invalid_version_regex = re.compile('([0- 1 file changed, 10 insertions(+)
diff --git a/TagsCheck.py b/TagsCheck.py
index 3c68d28..4141bbc 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -422,6 +422,7 @@ invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECA
# () are here for grouping purpose in the regexp # () are here for grouping purpose in the regexp
forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE) forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE)
valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost')) valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost'))
@ -10,7 +20,7 @@ Index: TagsCheck.py
use_epoch = Config.getOption('UseEpoch', False) use_epoch = Config.getOption('UseEpoch', False)
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
max_line_len = Config.getOption('MaxLineLength', 79) max_line_len = Config.getOption('MaxLineLength', 79)
@@ -599,6 +600,9 @@ class TagsCheck(AbstractCheck.AbstractCh @@ -602,6 +603,9 @@ class TagsCheck(AbstractCheck.AbstractCheck):
if d[0].startswith('/usr/local/'): if d[0].startswith('/usr/local/'):
printError(pkg, 'invalid-dependency', d[0]) printError(pkg, 'invalid-dependency', d[0])
@ -20,7 +30,7 @@ Index: TagsCheck.py
if is_source: if is_source:
if lib_devel_number_regex.search(d[0]): if lib_devel_number_regex.search(d[0]):
printError(pkg, 'invalid-build-requires', d[0]) printError(pkg, 'invalid-build-requires', d[0])
@@ -1106,6 +1110,12 @@ explicit Requires: tags.''', @@ -1127,6 +1131,12 @@ unneeded explicit Requires: tags.''',
'''This package provides 2 times the same capacity. It should only provide it '''This package provides 2 times the same capacity. It should only provide it
once.''', once.''',

View File

@ -1,8 +1,18 @@
Index: BinariesCheck.py From aa956808bc3b035e80a77904d8c8d125de311fb8 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] libtool-wrapper-check.diff
=================================================================== ===================================================================
--- BinariesCheck.py.orig ---
+++ BinariesCheck.py BinariesCheck.py | 20 ++++++++++++++++++++
@@ -313,8 +313,19 @@ class BinariesCheck(AbstractCheck.Abstra 1 file changed, 20 insertions(+)
diff --git a/BinariesCheck.py b/BinariesCheck.py
index c1c566d..b92c01e 100644
--- a/BinariesCheck.py
+++ b/BinariesCheck.py
@@ -316,8 +316,19 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
is_ar = 'current ar archive' in pkgfile.magic is_ar = 'current ar archive' in pkgfile.magic
is_ocaml_native = 'Objective caml native' in pkgfile.magic is_ocaml_native = 'Objective caml native' in pkgfile.magic
is_lua_bytecode = 'Lua bytecode' in pkgfile.magic is_lua_bytecode = 'Lua bytecode' in pkgfile.magic
@ -22,7 +32,7 @@ Index: BinariesCheck.py
if not is_binary: if not is_binary:
if reference_regex.search(fname): if reference_regex.search(fname):
lines = pkg.grep(invalid_dir_ref_regex, fname) lines = pkg.grep(invalid_dir_ref_regex, fname)
@@ -572,6 +583,15 @@ recompiled separately from the static li @@ -579,6 +590,15 @@ recompiled separately from the static libraries with the -fPIC option.
Another common mistake that causes this problem is linking with Another common mistake that causes this problem is linking with
``gcc -Wl,-shared'' instead of ``gcc -shared''.''', ``gcc -Wl,-shared'' instead of ``gcc -shared''.''',

View File

@ -1,19 +0,0 @@
--- rpmlint.py
+++ rpmlint.py
@@ -16,6 +16,7 @@ import Pkg
import Config
import os
import stat
+import locale
import rpm
from Filter import *
import SpecCheck
@@ -42,6 +43,8 @@ def loadCheck(name):
# main program
#############################################################################
def main():
+
+ locale.setlocale(locale.LC_ALL, '')
# Load all the tests
for c in Config.allChecks():
loadCheck(c)

View File

@ -1,34 +0,0 @@
Index: I18NCheck.py
===================================================================
--- I18NCheck.py.orig
+++ I18NCheck.py
@@ -38,22 +38,22 @@ INCORRECT_LOCALES = {
#
# 'en_RN' and 'en@IPA' are not real language bu funny variations on english
CORRECT_SUBDIRS = (
-'af', 'am', 'ang', 'ar', 'as', 'az', 'az_IR', 'be', 'bg', 'bn', 'bn_IN', 'br',
-'bs', 'ca', 'cs', 'cy', 'da', 'de', 'de_AT', 'dz', 'el',
+'af', 'am', 'ang', 'ar', 'as', 'az', 'az_IR', 'be', 'be@latin', 'bg', 'bn', 'bn_IN', 'br',
+'bs', 'ca', 'ca@valencia', 'cs', 'cy', 'da', 'de', 'de_AT', 'dz', 'el',
'en_AU', 'en_CA', 'en_GB', 'en_IE', 'en_US', 'en_RN', 'en@IPA',
'eo', 'es', 'es_AR', 'es_ES', 'es_DO', 'es_GT', 'es_HN', 'es_SV', 'es_PE',
'es_PA', 'es_MX', 'et', 'eu',
'fa', 'fi', 'fo', 'fr', 'fur', 'ga', 'gd', 'gl', 'gn', 'gu', 'gv',
'he', 'hi', 'hr', 'hu', 'hy',
-'ia', 'id', 'is', 'it', 'iu', 'ja', 'ka', 'kl', 'km', 'kn', 'ko', 'ku', 'kw',
+'ia', 'id', 'io', 'is', 'it', 'iu', 'ja', 'ka', 'kl', 'km', 'kn', 'ko', 'ku', 'kw',
# 'ltg' is not a standard ISO code; latgalian hasn't yet an ISO code
-'ky', 'lg', 'li', 'lo', 'lt', 'ltg', 'lv',
+'ky', 'lg', 'li', 'lo', 'lt', 'ltg', 'lv', 'mai', 'md',
'mg', 'mi', 'mk', 'ml', 'mn', 'mr', 'ms', 'mt', 'my',
'nb', 'nds', 'nds_DE', 'ne', 'nl', 'nn', 'no', 'nr', 'nso',
-'oc', 'or', 'pa_IN', 'ph', 'pl', 'pp', 'pt', 'pt_BR', 'qu', 'ro', 'ru', 'rw',
-'sc', 'se', 'si', 'sk', 'sl', 'sq', 'sr', 'sr@Latn', 'sr@ije', 'ss', 'st',
+'oc', 'or', 'pa_IN', 'ph', 'pl', 'pp', 'ps', 'pt', 'pt_BR', 'qu', 'ro', 'ru', 'rw',
+'sc', 'se', 'si', 'sk', 'sl', 'sq', 'sr', 'sr@latin', 'sr@ije', 'ss', 'st',
'sv', 'ta', 'te', 'tg', 'th', 'tk', 'tl', 'tn', 'tr', 'ts', 'tt',
-'ug', 'uk', 'ur', 'uz', 'uz@Latn',
+'ug', 'uk', 'ur', 'uz', 'uz@cyrillic',
've', 'vi', 'wa', 'wen', 'xh', 'yi', 'yo', 'zh_CN', 'zh_HK', 'zh_TW', 'zu',
# KDE uses 'ven' for 've'
'ven',

View File

@ -1,30 +0,0 @@
--- InitScriptCheck.py
+++ InitScriptCheck.py
@@ -101,7 +101,7 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
in_lsb_tag = 0
for i in lsb_tags.keys():
if len(lsb_tags[i]) != 1:
- printError(pkg, 'redundant-lsb-keyword', i)
+ printError(pkg, 'redundant-lsb-keyword', "'%s' in %s" % (i, f))
# TODO: where is it specified that these (or some)
# keywords are mandatory?
@@ -118,7 +118,7 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
cres = lsb_cont_regex.search(line)
if not (in_lsb_description and cres):
in_lsb_description = 0
- printError(pkg, 'malformed-line-in-lsb-comment-block', line)
+ printError(pkg, 'malformed-line-in-lsb-comment-block', "'%s' in %s" % (line,f))
else:
lsb_tags["Description"][-1] += " " + cres.group(1)
else:
@@ -127,7 +127,7 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
tag not in ('Provides', 'Required-Start', 'Required-Stop',
'Should-Stop', 'Should-Start', 'Default-Stop',
'Default-Start', 'Description', 'Short-Description'):
- printError(pkg, 'unknown-lsb-keyword', line)
+ printError(pkg, 'unknown-lsb-keyword', "'%s' in %s" % (line, f))
else:
in_lsb_description = (tag == 'Description')
if not tag in lsb_tags.keys():

View File

@ -1,8 +1,19 @@
Index: Filter.py From a6b4dc66618b5284b1e705393111cb26092009d6 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] no-badness-return.diff
=================================================================== ===================================================================
--- Filter.py.orig ---
+++ Filter.py Filter.py | 2 +-
@@ -113,7 +113,7 @@ def printAllReasons(): rpmlint | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Filter.py b/Filter.py
index eaa8384..40fbf79 100644
--- a/Filter.py
+++ b/Filter.py
@@ -120,7 +120,7 @@ def printAllReasons():
if len(last_reason): if len(last_reason):
printDescriptions(last_reason) printDescriptions(last_reason)
last_reason = reason last_reason = reason
@ -11,11 +22,11 @@ Index: Filter.py
if Config.info and len(last_reason): if Config.info and len(last_reason):
printDescriptions(last_reason) printDescriptions(last_reason)
_diagnostic = list() _diagnostic = list()
Index: rpmlint diff --git a/rpmlint b/rpmlint
=================================================================== index aa37c3a..8853e79 100755
--- rpmlint.orig --- a/rpmlint
+++ rpmlint +++ b/rpmlint
@@ -214,7 +214,7 @@ def main(): @@ -202,7 +202,7 @@ def main():
% (packages_checked, specfiles_checked, % (packages_checked, specfiles_checked,
printed_messages["E"], printed_messages["W"])) printed_messages["E"], printed_messages["W"]))

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From 2c88f9b0eb575a7f528d12863f3af6077664f3c8 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] no-doc-for-lib.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 2 +-
@@ -823,7 +823,7 @@ class FilesCheck(AbstractCheck.AbstractC 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 9532011..5929146 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -846,7 +846,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
debuginfo_srcs = False debuginfo_srcs = False
debuginfo_debugs = False debuginfo_debugs = False

View File

@ -1,8 +1,18 @@
Index: BinariesCheck.py From 8a5d81397414727ae834415be81619f2fc92b525 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] noarch-lib64.diff
=================================================================== ===================================================================
--- BinariesCheck.py.orig ---
+++ BinariesCheck.py BinariesCheck.py | 15 ++++++++++++++-
@@ -291,6 +291,7 @@ class BinariesCheck(AbstractCheck.Abstra 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/BinariesCheck.py b/BinariesCheck.py
index b92c01e..aff0f9f 100644
--- a/BinariesCheck.py
+++ b/BinariesCheck.py
@@ -294,6 +294,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
binary = False binary = False
binary_in_usr_lib = False binary_in_usr_lib = False
has_usr_lib_file = False has_usr_lib_file = False
@ -10,7 +20,7 @@ Index: BinariesCheck.py
multi_pkg = False multi_pkg = False
srpm = pkg[rpm.RPMTAG_SOURCERPM] srpm = pkg[rpm.RPMTAG_SOURCERPM]
@@ -309,6 +310,10 @@ class BinariesCheck(AbstractCheck.Abstra @@ -312,6 +313,10 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
# only-non-binary-in-usr-lib false positives # only-non-binary-in-usr-lib false positives
binary_in_usr_lib = True binary_in_usr_lib = True
@ -21,7 +31,7 @@ Index: BinariesCheck.py
is_elf = 'ELF' in pkgfile.magic is_elf = 'ELF' in pkgfile.magic
is_ar = 'current ar archive' in pkgfile.magic is_ar = 'current ar archive' in pkgfile.magic
is_ocaml_native = 'Objective caml native' in pkgfile.magic is_ocaml_native = 'Objective caml native' in pkgfile.magic
@@ -534,9 +539,12 @@ class BinariesCheck(AbstractCheck.Abstra @@ -541,9 +546,12 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
if version and version != -1 and version not in pkg.name: if version and version != -1 and version not in pkg.name:
printError(pkg, 'incoherent-version-in-name', version) printError(pkg, 'incoherent-version-in-name', version)
@ -35,7 +45,7 @@ Index: BinariesCheck.py
if has_usr_lib_file and not binary_in_usr_lib: if has_usr_lib_file and not binary_in_usr_lib:
printWarning(pkg, 'only-non-binary-in-usr-lib') printWarning(pkg, 'only-non-binary-in-usr-lib')
@@ -560,6 +568,11 @@ FHS and the FSSTND forbid this.''', @@ -567,6 +575,11 @@ FHS and the FSSTND forbid this.''',
# 'non-sparc32-binary', # 'non-sparc32-binary',
# '', # '',

View File

@ -1,8 +1,18 @@
Index: InitScriptCheck.py From b4792fd36155f64d0ce8b02c12d68535411d7770 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] only-reg-files-are-scripts.diff
=================================================================== ===================================================================
--- InitScriptCheck.py.orig ---
+++ InitScriptCheck.py InitScriptCheck.py | 5 ++++-
@@ -18,7 +18,7 @@ from Filter import addDetails, printErro 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/InitScriptCheck.py b/InitScriptCheck.py
index 5d851d4..fb53d93 100644
--- a/InitScriptCheck.py
+++ b/InitScriptCheck.py
@@ -18,7 +18,7 @@ from Filter import addDetails, printError, printWarning
import AbstractCheck import AbstractCheck
import Config import Config
import Pkg import Pkg
@ -11,7 +21,7 @@ Index: InitScriptCheck.py
chkconfig_content_regex = re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+') 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) subsys_regex = re.compile('/var/lock/subsys/([^/"\'\n\s;&|]+)', re.MULTILINE)
@@ -64,6 +64,9 @@ class InitScriptCheck(AbstractCheck.Abst @@ -50,6 +50,9 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
not fname.startswith('/etc/rc.d/init.d/'): not fname.startswith('/etc/rc.d/init.d/'):
continue continue

View File

@ -1,27 +0,0 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -119,6 +119,8 @@
sparc_regex=re.compile('SPARC32PLUS|SPARC V9|UltraSPARC')
system_lib_paths=Config.getOption('SystemLibPaths', DEFAULT_SYSTEM_LIB_PATHS)
usr_lib_regex=re.compile('^/usr/lib(64)?/')
+lib_perl_regex=re.compile('^/usr/lib/perl5/(?:vendor_perl/)?([0-9]+\.[0-9]+)\.([0-9]+)/')
+perl_version_trick=Config.getOption('PerlVersionTrick', 1)
bin_regex=re.compile('^(/usr(/X11R6)?)?/s?bin/')
soversion_regex=re.compile('.*?([0-9][.0-9]*)\\.so|.*\\.so\\.([0-9][.0-9]*).*')
reference_regex=re.compile('\.la$|^/usr/lib(64)?/pkgconfig/')
@@ -234,7 +236,14 @@
if p in system_lib_paths or \
not usr_lib_regex.search(p):
printError(pkg, 'binary-or-shlib-defines-rpath', i[0], bin_info.rpath)
- break
+ res=lib_perl_regex.search(p)
+ if res:
+ if perl_version_trick:
+ vers = res.group(1) + '.' + res.group(2)
+ else:
+ vers = res.group(1) + res.group(2)
+ if not (pkg.check_versioned_dep('perl', vers)):
+ printError(pkg, "no-dependency-on", "perl", vers)
# statically linked ?
is_exec=executable_regex.search(i[1])

View File

@ -1,14 +1,22 @@
From 40b4e731258c4e03f298f27691e22ae4ca650ebb Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] remove-expand-macros.diff
commit 29e43a3e1676aa452f730a741d00ef4ac7baec96 commit 29e43a3e1676aa452f730a741d00ef4ac7baec96
Author: Ludwig Nussel <ludwig.nussel@suse.de> Author: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Tue May 17 12:56:38 2011 +0200 Date: Tue May 17 12:56:38 2011 +0200
remove-expand-macros.diff remove-expand-macros.diff
---
TagsCheck.py | 27 ---------------------------
1 file changed, 27 deletions(-)
Index: TagsCheck.py diff --git a/TagsCheck.py b/TagsCheck.py
=================================================================== index fc392e5..40ce77a 100644
--- TagsCheck.py.orig --- a/TagsCheck.py
+++ TagsCheck.py +++ b/TagsCheck.py
@@ -431,15 +431,6 @@ so_dep_regex = re.compile(r'\.so(\.[0-9a @@ -432,15 +432,6 @@ so_dep_regex = re.compile(r'\.so(\.[0-9a-zA-z]+)*(\([^)]*\))*$')
# we assume that no rpm packages existed before rpm itself existed... # we assume that no rpm packages existed before rpm itself existed...
oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d")) oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d"))
@ -22,11 +30,11 @@ Index: TagsCheck.py
- private_so_paths.add(re.sub(r'/lib(?=/|$)', '/lib64', epath)) - private_so_paths.add(re.sub(r'/lib(?=/|$)', '/lib64', epath))
- -
_enchant_checkers = {} _enchant_checkers = {}
def spell_check(pkg, str, fmt, lang, ignored):
@@ -864,30 +855,12 @@ class TagsCheck(AbstractCheck.AbstractCh
(apply(Pkg.formatRequire, obs), @@ -886,30 +877,12 @@ class TagsCheck(AbstractCheck.AbstractCheck):
apply(Pkg.formatRequire, prov))) (Pkg.formatRequire(*obs),
Pkg.formatRequire(*prov)))
- expfmt = rpm.expandMacro("%{_build_name_fmt}") - expfmt = rpm.expandMacro("%{_build_name_fmt}")
- if pkg.isSource(): - if pkg.isSource():
@ -41,8 +49,8 @@ Index: TagsCheck.py
for tag in ('Distribution', 'DistTag', 'ExcludeArch', 'ExcludeOS', for tag in ('Distribution', 'DistTag', 'ExcludeArch', 'ExcludeOS',
'Vendor'): 'Vendor'):
if hasattr(rpm, 'RPMTAG_%s' % tag.upper()): if hasattr(rpm, 'RPMTAG_%s' % tag.upper()):
self._unexpanded_macros( self._unexpanded_macros(pkg, tag,
pkg, tag, pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())]) Pkg.b2s(pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())]))
- for path in private_so_paths: - for path in private_so_paths:
- for fname, pkgfile in pkg.files().items(): - for fname, pkgfile in pkg.files().items():
@ -50,8 +58,8 @@ Index: TagsCheck.py
- for prov in pkgfile.provides: - for prov in pkgfile.provides:
- if so_dep_regex.search(prov[0]): - if so_dep_regex.search(prov[0]):
- printWarning(pkg, "private-shared-object-provides", - printWarning(pkg, "private-shared-object-provides",
- fname, apply(Pkg.formatRequire, prov)) - fname, Pkg.formatRequire(*prov))
- -
def check_description(self, pkg, lang, ignored_words): def check_description(self, pkg, lang, ignored_words):
description = pkg.langtag(rpm.RPMTAG_DESCRIPTION, lang) description = pkg.langtag(rpm.RPMTAG_DESCRIPTION, lang)
self._unexpanded_macros(pkg, '%%description -l %s' % lang, description)

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From e64c8d7222e0e6418f3dff1cdd2229a5c47286dd Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] rpmgroup-checks.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 6 ++++++
@@ -722,6 +722,8 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 6 insertions(+)
diff --git a/TagsCheck.py b/TagsCheck.py
index 9e00892..b1c4c7a 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -723,6 +723,8 @@ class TagsCheck(AbstractCheck.AbstractCheck):
self._unexpanded_macros(pkg, 'Group', group) self._unexpanded_macros(pkg, 'Group', group)
if not group: if not group:
printError(pkg, 'no-group-tag') printError(pkg, 'no-group-tag')
@ -11,7 +21,7 @@ Index: TagsCheck.py
elif VALID_GROUPS and group not in VALID_GROUPS: elif VALID_GROUPS and group not in VALID_GROUPS:
printWarning(pkg, 'non-standard-group', group) printWarning(pkg, 'non-standard-group', group)
@@ -1034,6 +1036,10 @@ won't fool the specfile parser, and rebu @@ -1036,6 +1038,10 @@ won't fool the specfile parser, and rebuild the package.''',
'''There is no Group tag in your package. You have to specify a valid group '''There is no Group tag in your package. You have to specify a valid group
in your spec file using the Group tag.''', in your spec file using the Group tag.''',

View File

@ -1,22 +0,0 @@
From e6c176c7d03f377e55d405ebe5d0368f688426c7 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@nwra.com>
Date: Thu, 11 Jul 2013 12:29:34 -0600
Subject: [PATCH] Fix setgroups error name
---
BinariesCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: rpmlint-1.5/BinariesCheck.py
===================================================================
--- rpmlint-1.5.orig/BinariesCheck.py
+++ rpmlint-1.5/BinariesCheck.py
@@ -518,7 +518,7 @@ class BinariesCheck(AbstractCheck.Abstra
printError(pkg, 'missing-PT_GNU_STACK-section', fname)
if bin_info.setgid and bin_info.setuid and not bin_info.setgroups:
- printError(pkg, 'missing-call-to-setgroups', fname)
+ printError(pkg, 'missing-call-to-setgroups-before-setuid', fname)
if bin_info.chroot:
if not bin_info.chdir or not bin_info.chroot_near_chdir:

View File

@ -1,165 +0,0 @@
From c45057466e8e40bbb36fa90faa10a2b678c25ba2 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Wed, 30 Apr 2014 16:35:20 +0200
Subject: [PATCH rpmlint] disallow /var/run and /var/lock
Distros moved to having /var/run and /var/lock as symlinks to /run resp
/run/lock. Therefore packages must no longer put files there at all.
Also, refactor the code for dir-or-file-in-* and make it configurable.
---
FilesCheck.py | 77 +++++++++++++++++++++++------------------------------------
config | 4 ++++
2 files changed, 34 insertions(+), 47 deletions(-)
Index: rpmlint-1.5/FilesCheck.py
===================================================================
--- rpmlint-1.5.orig/FilesCheck.py
+++ rpmlint-1.5/FilesCheck.py
@@ -559,12 +559,9 @@ STANDARD_DIRS = (
'/var/lib/nobody',
'/var/lib/pam_devperm',
'/var/lib/wwwrun',
- '/var/lock',
- '/var/lock/subsys',
'/var/log',
'/var/mail',
'/var/opt',
- '/var/run',
'/var/spool',
'/var/spool/clientmqueue',
'/var/spool/locks',
@@ -589,7 +586,19 @@ DEFAULT_STANDARD_GROUPS = ('root', 'bin'
'shutdown', 'halt', 'mail', 'news', 'uucp',
'man', 'nobody',)
-tmp_regex = re.compile('^(/var|/usr)?/tmp/')
+DEFAULT_DISALLOWED_DIRS = (
+ '/home',
+ '/mnt',
+ '/opt',
+ '/tmp',
+ '/usr/local',
+ '/usr/tmp',
+ '/var/local',
+ '/var/lock',
+ '/var/run',
+ '/var/tmp',
+)
+
sub_bin_regex = re.compile('^(/usr)?/s?bin/\S+/')
backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.orig\.gz|\.rej)$')
compr_regex = re.compile('\.(gz|z|Z|zip|bz2|lzma|xz)$')
@@ -653,6 +662,8 @@ use_relative_symlinks = Config.getOption
standard_groups = Config.getOption('StandardGroups', DEFAULT_STANDARD_GROUPS)
standard_users = Config.getOption('StandardUsers', DEFAULT_STANDARD_USERS)
+disallowed_dirs = Config.getOption('DisallowedDirs', DEFAULT_DISALLOWED_DIRS)
+
non_readable_regexs = (re.compile('^/var/log/'),
re.compile('^/etc/(g?shadow-?|securetty)$'))
@@ -871,19 +882,13 @@ class FilesCheck(AbstractCheck.AbstractC
is_kernel_package:
printError(pkg, "kernel-modules-not-in-kernel-packages", f)
- for i in ['mnt','opt','usr-local','var-local','home']:
- if f.startswith('/%s/' % i.replace('-','/')):
- printError(pkg, 'dir-or-file-in-%s' % i, f)
-
- if tmp_regex.search(f):
- printError(pkg, 'dir-or-file-in-tmp', f)
+ for i in disallowed_dirs:
+ if f.startswith(i):
+ printError(pkg, 'dir-or-file-in-%s' % '-'.join(i.split('/')[1:]), f)
- elif f.startswith('/var/run/'):
+ if f.startswith('/run/'):
if f not in ghost_files:
- printWarning(pkg, 'non-ghost-in-var-run', f)
- elif f.startswith('/var/lock/'):
- if f not in ghost_files:
- printWarning(pkg, 'non-ghost-in-var-lock', f)
+ printWarning(pkg, 'non-ghost-in-run', f)
elif sub_bin_regex.search(f):
printError(pkg, 'subdir-in-bin', f)
elif '/site_perl/' in f:
@@ -1466,35 +1471,10 @@ install-info.''',
'''You have a perl temporary file in your package. Usually, this
file is beginning with a dot (.) and contain "perl" in its name.''',
-'dir-or-file-in-tmp',
-'''A file in the package is located in /tmp. It's not permitted
-for packages to install files in this directory.''',
-
-'dir-or-file-in-mnt',
-'''A file in the package is located in /mnt. It's not permitted
-for packages to install files in this directory.''',
-
-'dir-or-file-in-opt',
-'''A file in the package is located in /opt. It's not permitted
-for packages to install files in this directory.''',
-
-'dir-or-file-in-usr-local',
-'''A file in the package is located in /usr/local. It's not permitted
-for packages to install files in this directory.''',
-
-'dir-or-file-in-var-local',
-'''A file in the package is located in /var/local. It's not permitted
-for packages to install files in this directory.''',
-
-'non-ghost-in-var-run',
-'''A file or directory in the package is located in /var/run. Files installed
-in this directory should be marked as %ghost and created at runtime to work
-properly in tmpfs /var/run setups.''',
-
-'non-ghost-in-var-lock',
-'''A file or directory in the package is located in /var/lock. Files installed
+'non-ghost-in-run',
+'''A file or directory in the package is located in /run. Files installed
in this directory should be marked as %ghost and created at runtime to work
-properly in tmpfs /var/lock setups.''',
+properly in tmpfs /run setups.''',
'subdir-in-bin',
'''The package contains a subdirectory in /usr/bin. It's not permitted to
@@ -1505,10 +1485,6 @@ create a subdir there. Create it in /usr
by an editor or resulting from applying unclean (fuzzy, or ones with line
offsets) patches.''',
-'dir-or-file-in-home',
-'''A file in the package is located in /home. It's not permitted
-for packages to install files in this directory.''',
-
'version-control-internal-file',
'''You have included file(s) internally used by a version control system
in the package. Move these files out of the package and rebuild it.''',
@@ -1832,6 +1808,13 @@ as part of the example documentation mea
use it and setup a insecure configuration.'''
)
+for i in disallowed_dirs:
+ addDetails('dir-or-file-in-%s' % '-'.join(i.split('/')[1:]),
+ '''A file in the package is located in %s. It's not permitted
+for packages to install files in this directory.''' % i)
+
+
+
# FilesCheck.py ends here
# Local variables:
Index: rpmlint-1.5/config
===================================================================
--- rpmlint-1.5.orig/config
+++ rpmlint-1.5/config
@@ -126,6 +126,10 @@ from Config import *
# Type: tuple of strings, see DEFAULT_STANDARD_USERS in FilesCheck
#setOption("StandardUsers", ())
+# List of directory prefixes that are not allowed in packages
+# Type: tuple of strings, see DEFAULT_DISALLOWED_DIRS in FilesCheck
+#setOption("DisallowedDirs", ('/home', '/mnt'))
+
# List of directories considered to be system default library search paths.
# Type: tuple of strings, default: see DEFAULT_SYSTEM_LIB_PATHS in BinariesCheck
#setOption("SystemLibPaths", ('/lib', '/lib64', '/usr/lib', '/usr/lib64'))

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

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

View File

@ -1,207 +0,0 @@
Index: rpmlint-1.5/Pkg.py
===================================================================
--- rpmlint-1.5.orig/Pkg.py
+++ rpmlint-1.5/Pkg.py
@@ -85,7 +85,7 @@ def getstatusoutput(cmd, stdoutonly = Fa
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, close_fds=True)
proc.stdin.close()
- text = proc.stdout.read().decode()
+ text = proc.stdout.read()
sts = proc.wait()
if sts is None:
sts = 0
diff -ruN rpmlint-1.5/BinariesCheck.py rpmlint-1.5.new/BinariesCheck.py
--- rpmlint-1.5/BinariesCheck.py 2014-02-27 12:06:25.018163441 +0100
+++ rpmlint-1.5.new/BinariesCheck.py 2014-02-27 12:04:14.210110261 +0100
@@ -198,7 +198,7 @@
try:
fobj = open(path, 'rb')
fobj.seek(-12, 2) # 2 == os.SEEK_END, for python 2.4 compat (#172)
- self.tail = fobj.read().decode()
+ self.tail = fobj.read()
except Exception:
e = sys.exc_info()[1]
printWarning(pkg, 'binaryinfo-tail-failed %s: %s' % (file, e))
@@ -296,7 +296,7 @@
multi_pkg = False
srpm = pkg[rpm.RPMTAG_SOURCERPM]
if srpm:
- res = srcname_regex.search(srpm.decode())
+ res = srcname_regex.search(srpm)
if res:
multi_pkg = (pkg.name != res.group(1))
diff -ruN rpmlint-1.5/DocFilesCheck.py rpmlint-1.5.new/DocFilesCheck.py
--- rpmlint-1.5/DocFilesCheck.py 2014-02-27 12:06:24.826161897 +0100
+++ rpmlint-1.5.new/DocFilesCheck.py 2014-02-27 12:04:29.681234928 +0100
@@ -44,7 +44,7 @@
# register things which are provided by the package
for i in pkg.header[rpm.RPMTAG_PROVIDES]:
- core_reqs[i.decode()] = []
+ core_reqs[i] = []
for i in files:
core_reqs[i] = []
diff -ruN rpmlint-1.5/FilesCheck.py rpmlint-1.5.new/FilesCheck.py
--- rpmlint-1.5/FilesCheck.py 2014-02-27 12:06:25.012163393 +0100
+++ rpmlint-1.5.new/FilesCheck.py 2014-02-27 12:04:41.277328352 +0100
@@ -957,11 +957,11 @@
# Prefetch scriptlets, strip quotes from them (#169)
postin = (pkg[rpm.RPMTAG_POSTIN] or \
- pkg.scriptprog(rpm.RPMTAG_POSTINPROG)).decode()
+ pkg.scriptprog(rpm.RPMTAG_POSTINPROG))
if postin:
postin = quotes_regex.sub('', postin)
postun = (pkg[rpm.RPMTAG_POSTUN] or \
- pkg.scriptprog(rpm.RPMTAG_POSTUNPROG)).decode()
+ pkg.scriptprog(rpm.RPMTAG_POSTUNPROG))
if postun:
postun = quotes_regex.sub('', postun)
diff -ruN rpmlint-1.5/LSBCheck.py rpmlint-1.5.new/LSBCheck.py
--- rpmlint-1.5/LSBCheck.py 2014-02-27 12:06:24.827161905 +0100
+++ rpmlint-1.5.new/LSBCheck.py 2014-02-27 12:04:52.612419655 +0100
@@ -32,13 +32,11 @@
version = pkg[rpm.RPMTAG_VERSION]
if version:
- version = version.decode()
if not version_regex.search(version):
printError(pkg, 'non-lsb-compliant-version', version)
release = pkg[rpm.RPMTAG_RELEASE]
if release:
- release = release.decode()
if not version_regex.search(release):
printError(pkg, 'non-lsb-compliant-release', release)
diff -ruN rpmlint-1.5/Pkg.py rpmlint-1.5.new/Pkg.py
--- rpmlint-1.5/Pkg.py 2014-02-27 12:06:25.041163626 +0100
+++ rpmlint-1.5.new/Pkg.py 2014-02-27 12:03:33.599782891 +0100
@@ -448,7 +448,7 @@
os.close(fd)
self.is_source = not self.header[rpm.RPMTAG_SOURCERPM]
- self.name = self.header[rpm.RPMTAG_NAME].decode()
+ self.name = self.header[rpm.RPMTAG_NAME]
if self.isNoSource():
self.arch = 'nosrc'
elif self.isSource():
@@ -534,7 +534,7 @@
# LANGUAGE trumps other env vars per GNU gettext docs, see also #166
orig = os.environ.get('LANGUAGE')
os.environ['LANGUAGE'] = lang
- ret = self[tag].decode()
+ ret = self[tag]
if orig is not None:
os.environ['LANGUAGE'] = orig
return ret
@@ -599,17 +599,17 @@
modes = self.header[rpm.RPMTAG_FILEMODES]
users = self.header[rpm.RPMTAG_FILEUSERNAME]
groups = self.header[rpm.RPMTAG_FILEGROUPNAME]
- links = [x.decode() for x in self.header[rpm.RPMTAG_FILELINKTOS]]
+ links = self.header[rpm.RPMTAG_FILELINKTOS]
sizes = self.header[rpm.RPMTAG_FILESIZES]
md5s = self.header[rpm.RPMTAG_FILEMD5S]
mtimes = self.header[rpm.RPMTAG_FILEMTIMES]
rdevs = self.header[rpm.RPMTAG_FILERDEVS]
langs = self.header[rpm.RPMTAG_FILELANGS]
inodes = self.header[rpm.RPMTAG_FILEINODES]
- requires = [x.decode() for x in self.header[rpm.RPMTAG_FILEREQUIRE]]
- provides = [x.decode() for x in self.header[rpm.RPMTAG_FILEPROVIDE]]
- files = [x.decode() for x in self.header[rpm.RPMTAG_FILENAMES]]
- magics = [x.decode() for x in self.header[rpm.RPMTAG_FILECLASS]]
+ requires = self.header[rpm.RPMTAG_FILEREQUIRE]
+ provides = self.header[rpm.RPMTAG_FILEPROVIDE]
+ files = self.header[rpm.RPMTAG_FILENAMES]
+ magics = self.header[rpm.RPMTAG_FILECLASS]
try: # rpm >= 4.7.0
filecaps = self.header[rpm.RPMTAG_FILECAPS]
except:
@@ -736,8 +736,8 @@
if versions:
for loop in range(len(versions)):
- name = names[loop].decode()
- evr = stringToVersion(versions[loop].decode())
+ name = names[loop]
+ evr = stringToVersion(versions[loop])
if prereq is not None and flags[loop] & PREREQ_FLAG:
prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr))
elif strong_only and flags[loop] & rpm.RPMSENSE_STRONG:
diff -ruN rpmlint-1.5/rpmdiff rpmlint-1.5.new/rpmdiff
--- rpmlint-1.5/rpmdiff 2014-02-27 12:06:24.826161897 +0100
+++ rpmlint-1.5.new/rpmdiff 2014-02-27 12:03:50.387918248 +0100
@@ -228,16 +228,16 @@
if namestr == 'REQUIRES':
namestr = self.req2str(oldentry[1])
self.__add(self.DEPFORMAT,
- (self.REMOVED, namestr, oldentry[0].decode(),
- self.sense2str(oldentry[1]), oldentry[2].decode()))
+ (self.REMOVED, namestr, oldentry[0],
+ self.sense2str(oldentry[1]), oldentry[2]))
for newentry in n:
if not newentry in o:
namestr = name
if namestr == 'REQUIRES':
namestr = self.req2str(newentry[1])
self.__add(self.DEPFORMAT,
- (self.ADDED, namestr, newentry[0].decode(),
- self.sense2str(newentry[1]), newentry[2].decode()))
+ (self.ADDED, namestr, newentry[0],
+ self.sense2str(newentry[1]), newentry[2]))
def __fileIteratorToDict(self, fi):
result = {}
diff -ruN rpmlint-1.5/TagsCheck.py rpmlint-1.5.new/TagsCheck.py
--- rpmlint-1.5/TagsCheck.py 2014-02-27 12:06:25.036163586 +0100
+++ rpmlint-1.5.new/TagsCheck.py 2014-02-27 12:05:51.742895726 +0100
@@ -536,7 +536,6 @@
packager = pkg[rpm.RPMTAG_PACKAGER]
if packager:
- packager = packager.decode()
self._unexpanded_macros(pkg, 'Packager', packager)
if Config.getOption('Packager') and \
not packager_regex.search(packager):
@@ -546,7 +545,6 @@
version = pkg[rpm.RPMTAG_VERSION]
if version:
- version = version.decode()
self._unexpanded_macros(pkg, 'Version', version)
res = invalid_version_regex.search(version)
if res:
@@ -556,7 +554,6 @@
release = pkg[rpm.RPMTAG_RELEASE]
if release:
- release = release.decode()
self._unexpanded_macros(pkg, 'Release', release)
if release_ext and not extension_regex.search(release):
printWarning(pkg, 'not-standard-release-extension', release)
@@ -688,12 +685,9 @@
ignored_words.update((x[0] for x in pkg.obsoletes()))
langs = pkg[rpm.RPMTAG_HEADERI18NTABLE]
- if langs:
- langs = [x.decode() for x in langs]
summary = pkg[rpm.RPMTAG_SUMMARY]
if summary:
- summary = summary.decode()
if not langs:
self._unexpanded_macros(pkg, 'Summary', summary)
else:
@@ -704,7 +698,6 @@
description = pkg[rpm.RPMTAG_DESCRIPTION]
if description:
- description = description.decode()
if not langs:
self._unexpanded_macros(pkg, '%description', description)
else:

View File

@ -1,9 +1,19 @@
Index: Pkg.py From 2fba34a1d8087aacb178556d0e40923b749e9035 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] rpmlint-pkg-quoting.diff
=================================================================== ===================================================================
--- Pkg.py.orig ---
+++ Pkg.py Pkg.py | 2 +-
@@ -493,7 +493,7 @@ class Pkg: 1 file changed, 1 insertion(+), 1 deletion(-)
dir = self.dirname)
diff --git a/Pkg.py b/Pkg.py
index cfaa5a9..f7dc31d 100644
--- a/Pkg.py
+++ b/Pkg.py
@@ -536,7 +536,7 @@ class Pkg:
dir=self.dirname)
# TODO: better shell escaping or sequence based command invocation # TODO: better shell escaping or sequence based command invocation
command_str = \ command_str = \
- 'rpm2cpio "%s" | (cd "%s"; cpio -id); chmod -R +rX "%s"' % \ - 'rpm2cpio "%s" | (cd "%s"; cpio -id); chmod -R +rX "%s"' % \

View File

@ -1,8 +1,19 @@
Index: FilesCheck.py From cb3e5a520e82ca2dd8a952e116067ada26d2497a Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:37 +0200
Subject: [PATCH] rpmlint-suse.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 2 +-
@@ -176,7 +176,7 @@ compr_regex = re.compile('\.(gz|z|Z|zip| I18NCheck.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 1ad548b..1a70779 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -184,7 +184,7 @@ compr_regex = re.compile('\.(gz|z|Z|zip|bz2|lzma|xz)$')
absolute_regex = re.compile('^/([^/]+)') absolute_regex = re.compile('^/([^/]+)')
absolute2_regex = re.compile('^/?([^/]+)') absolute2_regex = re.compile('^/?([^/]+)')
points_regex = re.compile('^\.\./(.*)') points_regex = re.compile('^\.\./(.*)')
@ -11,10 +22,10 @@ Index: FilesCheck.py
bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)')
includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE)
develfile_regex = re.compile('\.(a|cmxa?|mli?)$') develfile_regex = re.compile('\.(a|cmxa?|mli?)$')
Index: I18NCheck.py diff --git a/I18NCheck.py b/I18NCheck.py
=================================================================== index 54b42cd..3bcf9d0 100644
--- I18NCheck.py.orig --- a/I18NCheck.py
+++ I18NCheck.py +++ b/I18NCheck.py
@@ -30,7 +30,7 @@ INCORRECT_LOCALES = { @@ -30,7 +30,7 @@ INCORRECT_LOCALES = {
'en_UK': 'en_GB'} 'en_UK': 'en_GB'}

View File

@ -1,3 +1,45 @@
-------------------------------------------------------------------
Fri Apr 10 11:16:01 UTC 2015 - lnussel@suse.de
- new versioin 1.6
- add script update_git.sh based on qemu's to simplify importing
a patch series from git after rebasing.
* Patches dropped:
0001-Python-3-compatibility-tweaks.patch (upstream)
0001-Set-Python-3.4-magic-number-to-3310.patch (upstream)
add-scoring-support.diff (different upstream solution)
check-buildroot-during-install.diff (need to fix no-cleaning-of-buildroot check upstream)
fix-versioned-prereq.diff (was disabled, not sure what it's useful for)
ignore-non-readable-in-etc.diff (filtered anyways)
locale-support.diff (drop)
locale-update.diff (different upstream solution now)
more-verbose-lsb-check.diff (drop)
perl-versioned-rpath-deps.diff (upstream)
rpmlint-1.5-disallow-var-run-and-var-lock.diff (upstream)
rpmlint-1.5-Fix-setgroups-error-name.diff (upstream)
rpmlint-decode-fix.diff (different upstream solution)
rpmlint-fix-unexpanded-macros-for-array-values.patch (different upstream solution)
stricter-tags-check.diff (merged in weak deps and check-for-self-provides.diff)
suppress-for-perl-python.diff (use filter instead)
suse-binary-info-compile-opts.diff (drop)
suse-changelog.patch (change config instead)
suse-mono-deps-checks.diff (useful?)
suse-required-lsb-tags.diff (different upstream solution)
verify-buildrequires.diff (very build system specific, drop)
xdg-check-exception.diff (upstream)
* renamed patches:
script-interpreter-only-for-exec-scripts.diff
-> script-interpreter-only-for-exec-sc.diff
confusing-invalid-spec-name.patch
-> confusing-invalid-spec-name.diff
suse-manpages-for-rc-scripts.patch
-> suse-manpages-for-rc-scripts.diff
sysv5-init-checks.diff
-> suse-sysv-init-checks.diff
* added patches:
check-for-self-provides.diff
save-content-to-an-array.diff
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Apr 9 08:13:46 UTC 2015 - meissner@suse.com Thu Apr 9 08:13:46 UTC 2015 - meissner@suse.com

View File

@ -25,7 +25,7 @@ BuildRequires: xz
Summary: Rpm correctness checker Summary: Rpm correctness checker
License: GPL-2.0+ License: GPL-2.0+
Group: System/Packages Group: System/Packages
Version: 1.5 Version: 1.6
Release: 0 Release: 0
Source0: https://downloads.sourceforge.net/project/rpmlint/rpmlint-%{version}.tar.xz Source0: https://downloads.sourceforge.net/project/rpmlint/rpmlint-%{version}.tar.xz
Source1: rpmlint-checks-master.tar.gz Source1: rpmlint-checks-master.tar.gz
@ -49,88 +49,65 @@ Requires: python-magic
Requires: rpm-python Requires: rpm-python
# Requirement for ErlangCheck.py (pull-request #2). # Requirement for ErlangCheck.py (pull-request #2).
Requires: python-pybeam Requires: python-pybeam
BuildArch: noarch
# #
# Read README.packaging.txt before making any changes to this # Read README.packaging.txt before making any changes to this
# package # package
# #
Patch0: rpmlint-suse.diff # PATCHLIST BEGIN
Patch1: suse-checks.diff Patch00: rpmlint-suse.diff
Patch2: suse-version.diff Patch01: suse-checks.diff
Patch3: suse-url-check.diff Patch02: suse-version.diff
Patch5: suse-python3-naming-policy.diff Patch03: suse-url-check.diff
Patch6: suse-filesystem.diff Patch04: suse-python3-naming-policy.diff
Patch7: suse-pkg-config-check.diff Patch05: suse-filesystem.diff
Patch8: suse-binarieschecks.diff Patch06: suse-pkg-config-check.diff
Patch9: no-doc-for-lib.diff Patch07: suse-binarieschecks.diff
Patch10: add-scoring-support.diff Patch08: no-doc-for-lib.diff
Patch11: suse-filter-exception.diff Patch09: suse-filter-exception.diff
Patch12: usr-arch.diff Patch10: usr-arch.diff
Patch13: script-interpreter-only-for-exec-scripts.diff Patch11: script-interpreter-only-for-exec-sc.diff
Patch14: sourced-dirs.diff Patch12: sourced-dirs.diff
Patch15: suse-filter-more-verbose.diff Patch13: suse-filter-more-verbose.diff
Patch17: docdata-examples.diff Patch14: docdata-examples.diff
Patch18: 0001-Python-3-compatibility-tweaks.patch Patch15: yast-provides.diff
Patch19: yast-provides.diff Patch16: xdg-paths-update.diff
Patch20: xdg-paths-update.diff Patch17: better-wrong-script.diff
Patch22: better-wrong-script.diff Patch18: buildroot-doc.diff
Patch23: buildroot-doc.diff Patch19: rpmgroup-checks.diff
Patch24: sysv5-init-checks.diff Patch20: devel-provide-is-devel-package.diff
Patch26: ignore-non-readable-in-etc.diff Patch21: only-reg-files-are-scripts.diff
Patch29: rpmgroup-checks.diff Patch22: buildroot-in-scripts.diff
Patch30: devel-provide-is-devel-package.diff Patch23: libtool-wrapper-check.diff
Patch31: only-reg-files-are-scripts.diff Patch24: suse-check-optional-dependencies.diff
Patch33: check-buildroot-during-install.diff Patch25: noarch-lib64.diff
Patch34: verify-buildrequires.diff Patch26: suse-no-run-ldconfig.diff
Patch35: fix-versioned-prereq.diff Patch27: description-check.diff
Patch37: buildroot-in-scripts.diff Patch28: add-weak-dependencies.diff
Patch39: libtool-wrapper-check.diff Patch29: selfconflicts-provide.diff
Patch41: perl-versioned-rpath-deps.diff Patch30: no-badness-return.diff
Patch42: suse-check-optional-dependencies.diff Patch31: suse-shlib-devel-dependency.diff
Patch46: locale-support.diff Patch32: version-control-internal-file.diff
# not is also in CheckFilelist.py Patch33: avoid-mismatched-libregex.diff
Patch47: noarch-lib64.diff Patch34: filename-non-utf8-exception.diff
Patch49: stricter-tags-check.diff Patch35: stricter-interpreter-check.diff
Patch50: suse-no-run-ldconfig.diff Patch36: confusing-invalid-spec-name.diff
Patch51: description-check.diff Patch37: rpmlint-pkg-quoting.diff
# this is the wrong place here Patch38: suse-g-ir-chech.diff
Patch52: suppress-for-perl-python.diff Patch39: remove-expand-macros.diff
Patch54: locale-update.diff Patch40: suse-whitelist-opensuse.diff
Patch57: suse-mono-deps-checks.diff Patch41: extend-suse-conffiles-check.diff
Patch58: add-weak-dependencies.diff Patch42: compressed-backup-regex.diff
Patch60: selfconflicts-provide.diff Patch43: suse-speccheck-utf8.diff
Patch62: no-badness-return.diff Patch44: suse-python-abi-check.diff
Patch65: suse-shlib-devel-dependency.diff Patch45: suse-manpages-for-rc-scripts.diff
Patch67: suse-required-lsb-tags.diff Patch46: suse-ignore-specfile-errors.diff
Patch68: more-verbose-lsb-check.diff Patch47: invalid-filerequires.diff
Patch71: suse-binary-info-compile-opts.diff Patch48: suse-sysv-init-checks.diff
Patch72: version-control-internal-file.diff Patch49: check-for-self-provides.diff
Patch73: avoid-mismatched-libregex.diff Patch50: save-content-to-an-array.diff
Patch74: filename-non-utf8-exception.diff # PATCHLIST END
Patch75: stricter-interpreter-check.diff # BuildArch must at the and. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766
Patch76: confusing-invalid-spec-name.patch BuildArch: noarch
Patch77: rpmlint-pkg-quoting.diff
Patch78: suse-g-ir-chech.diff
Patch80: remove-expand-macros.diff
Patch81: suse-whitelist-opensuse.diff
Patch84: extend-suse-conffiles-check.diff
Patch85: suse-changelog.patch
Patch87: compressed-backup-regex.diff
# accepted upstream
Patch88: suse-speccheck-utf8.diff
Patch89: suse-python-abi-check.diff
# PATCH-FIX-OPENSUSE: saschpe@suse.de - Don't complain about missing man-pages for rc-scripts
Patch91: suse-manpages-for-rc-scripts.patch
# PATCH-FIX-UPSTREAM: lnussel@suse.de - Fix setgroups error name
Patch92: rpmlint-1.5-Fix-setgroups-error-name.diff
Patch93: xdg-check-exception.diff
Patch94: suse-ignore-specfile-errors.diff
Patch95: invalid-filerequires.diff
Patch96: rpmlint-decode-fix.diff
Patch97: rpmlint-fix-unexpanded-macros-for-array-values.patch
# PATCH-FIX-UPSTREAM: lnussel@suse.de - disallow /var/run and /var/lock
Patch98: rpmlint-1.5-disallow-var-run-and-var-lock.diff
Patch99: 0001-Set-Python-3.4-magic-number-to-3310.patch
%py_requires %py_requires
@ -139,80 +116,7 @@ Rpmlint is a tool to check common errors on rpm packages. Binary and
source packages can be checked. source packages can be checked.
%prep %prep
%setup -q -n rpmlint-%{version} -a1 %autosetup -n rpmlint-%{version} -a1 -p1
%patch0
%patch1
%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
#%patch10
%patch11
%patch12
%patch13
%patch14
%patch15
%patch17
%patch18 -p1
%patch19
%patch20
%patch22
%patch23
%patch24
#%patch26
%patch29
%patch30
%patch31
# needs rediff
#%patch33
#%patch34
#%patch35
%patch37
%patch39
#%patch41
%patch42
#%patch46
%patch47
#%patch49
%patch50
%patch51
#%patch52
### rediff!
#%patch54
#%patch57
%patch58
%patch60
%patch62
%patch65
#%patch67
#%patch68
#%patch71
%patch72
%patch73
%patch74
%patch75
%patch76 -p1
%patch77
%patch78
%patch80
%patch81
%patch84
%patch85
%patch87
%patch88
%patch89
%patch91 -p1
%patch92 -p1
%patch93 -p1
%patch94
%patch95
%patch96 -p1
%patch97 -p1
%patch98 -p1
%patch99 -p1
cp -p %{SOURCE2} . cp -p %{SOURCE2} .
# Only move top-level python files # Only move top-level python files
chmod 0755 rpmlint-checks-master/*.py chmod 0755 rpmlint-checks-master/*.py
@ -251,5 +155,6 @@ rm -rf $RPM_BUILD_ROOT
%config %{_sysconfdir}/rpmlint/licenses.config %config %{_sysconfdir}/rpmlint/licenses.config
%dir /etc/rpmlint %dir /etc/rpmlint
/usr/share/man/man1/rpmlint.1.gz /usr/share/man/man1/rpmlint.1.gz
/usr/share/man/man1/rpmdiff.1.gz
%changelog %changelog

View File

@ -0,0 +1,31 @@
From 6e26550f7b5583ab15ed5573bf8093d0adbf4cb0 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Fri, 10 Apr 2015 16:22:26 +0200
Subject: [PATCH rpmlint] save content to an array
due to the following join the generator would be at the end so iterating
through lines wouldn't work
Upstream ticket:
https://sourceforge.net/p/rpmlint/tickets/44/
---
InitScriptCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/InitScriptCheck.py b/InitScriptCheck.py
index 1a58562..9d197e5 100644
--- a/InitScriptCheck.py
+++ b/InitScriptCheck.py
@@ -103,7 +103,7 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
# check common error in file content
content = None
try:
- content = Pkg.readlines(pkgfile.path)
+ content = [ x for x in Pkg.readlines(pkgfile.path) ]
except Exception:
e = sys.exc_info()[1]
printWarning(pkg, 'read-error', e)
--
2.3.4

View File

@ -0,0 +1,23 @@
From 02de6fffb97981397beb75738c2a2afe4e47fd02 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] script-interpreter-only-for-exec-scripts.diff
===================================================================
---
FilesCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 5929146..80148c4 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -1242,7 +1242,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
# ...but executed ones should
elif interpreter or mode_is_exec 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,13 +0,0 @@
Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1219,7 +1219,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,8 +1,18 @@
Index: TagsCheck.py From aecc6b2cfb248014dd769a31a0aeb8f1bcec180b Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] selfconflicts-provide.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 7 +++++++
@@ -827,6 +827,7 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 7 insertions(+)
diff --git a/TagsCheck.py b/TagsCheck.py
index 6528d5b..18cbb6e 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -829,6 +829,7 @@ class TagsCheck(AbstractCheck.AbstractCheck):
obs_names = [x[0] for x in pkg.obsoletes()] obs_names = [x[0] for x in pkg.obsoletes()]
prov_names = [x[0].split(':/')[0] for x in pkg.provides()] prov_names = [x[0].split(':/')[0] for x in pkg.provides()]
@ -10,7 +20,7 @@ Index: TagsCheck.py
for o in (x for x in obs_names if x not in prov_names): for o in (x for x in obs_names if x not in prov_names):
printWarning(pkg, 'obsolete-not-provided', o) printWarning(pkg, 'obsolete-not-provided', o)
@@ -838,6 +839,8 @@ class TagsCheck(AbstractCheck.AbstractCh @@ -840,6 +841,8 @@ class TagsCheck(AbstractCheck.AbstractCheck):
# https://bugzilla.redhat.com/460872 # https://bugzilla.redhat.com/460872
useless_provides = [] useless_provides = []
for p in prov_names: for p in prov_names:
@ -19,7 +29,7 @@ Index: TagsCheck.py
if prov_names.count(p) != 1 and p not in useless_provides: if prov_names.count(p) != 1 and p not in useless_provides:
useless_provides.append(p) useless_provides.append(p)
for p in useless_provides: for p in useless_provides:
@@ -978,6 +981,10 @@ the Release tag.''', @@ -999,6 +1002,10 @@ the Release tag.''',
'''There is no Name tag in your package. You have to specify a name using the '''There is no Name tag in your package. You have to specify a name using the
Name tag.''', Name tag.''',

View File

@ -1,9 +1,19 @@
Index: FilesCheck.py From 77dda1bf07bd9468e5b0efe15b1b93aca4f460d9 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] sourced-dirs.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 2 +-
@@ -634,7 +634,7 @@ manifest_perl_regex = re.compile('^/usr/ 1 file changed, 1 insertion(+), 1 deletion(-)
shebang_regex = re.compile('^#!\s*(\S+)')
diff --git a/FilesCheck.py b/FilesCheck.py
index 80148c4..c485125 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -642,7 +642,7 @@ manifest_perl_regex = re.compile('^/usr/share/doc/perl-.*/MANIFEST(\.SKIP)?$')
shebang_regex = re.compile(b'^#!\s*(\S+)')
interpreter_regex = re.compile('^/(usr/)?(s?bin|games|libexec(/.+)?|(lib(64)?|share)/.+)/[^/]+$') 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)))/') 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)/') -sourced_script_regex = re.compile('^/etc/(bash_completion\.d|profile\.d)/')

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From e8167b76e48fdbd98062fa05e72e40fdb98eee96 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] stricter-interpreter-check.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 3 ++-
@@ -1245,7 +1245,8 @@ class FilesCheck(AbstractCheck.AbstractC 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 14cfca3..1b68dd5 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -1265,7 +1265,8 @@ class FilesCheck(AbstractCheck.AbstractCheck):
f.endswith('.la')): f.endswith('.la')):
printError(pkg, 'script-without-shebang', f) printError(pkg, 'script-without-shebang', f)
@ -11,4 +21,4 @@ Index: FilesCheck.py
+ interpreter and interpreter.startswith("/"): + interpreter and interpreter.startswith("/"):
printError(pkg, 'non-executable-script', f, printError(pkg, 'non-executable-script', f,
oct(perm), interpreter) oct(perm), interpreter)
if '\r' in chunk: if b'\r' in chunk:

View File

@ -1,84 +0,0 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -509,7 +509,7 @@
printError(pkg, 'explicit-lib-dependency', d[0])
if d[2] == rpm.RPMSENSE_EQUAL and string.find(d[1], '-') != -1:
printWarning(pkg, 'requires-on-release', d[0], d[1])
- if string.find(d[1], '%') != -1:
+ if string.find(d[1], '%') != -1 or string.find(d[0], '%') != -1:
printError(pkg, 'percent-in-dependency', d[0], d[1])
if not name:
@@ -680,6 +680,7 @@
obs_names = map(lambda x: x[0], pkg.obsoletes())
prov_names = map(lambda x: x[0].split(':/')[0], pkg.provides())
+ req_names = map(lambda x: x[0], pkg.requires() + pkg.prereq())
if pkg.name in obs_names:
printError(pkg, 'obsolete-on-name')
@@ -687,7 +688,7 @@
if not o in prov_names:
printWarning(pkg, 'obsolete-not-provided', o)
for o in pkg.obsoletes():
- if string.find(o[1], '%') != -1:
+ if string.find(o[1], '%') != -1 or string.find(o[0], '%') != -1:
printError(pkg, 'percent-in-obsoletes', o[0], o[1])
# TODO: should take versions, <, <=, =, >=, > into account here
@@ -700,14 +701,41 @@
for p in useless_provides:
printError(pkg, 'useless-provides', p)
+ useless_reqs=set()
+ for r in req_names:
+ if not r in useless_reqs:
+ useless_reqs.add(r)
+ else:
+ if r[0] != '/':
+ printWarning(pkg, 'useless-explicit-requires', r)
+
for p in pkg.provides():
- if string.find(p[1], '%') != -1:
+ if string.find(p[1], '%') != -1 or string.find(p[0], '%') != -1:
printError(pkg, 'percent-in-provides', p[0], p[1])
+ if p[0] == pkg.name and not p[1]:
+ printError(pkg, 'unversioned-explicit-self-provides', p[0])
+
for c in pkg.conflicts():
- if string.find(c[1], '%') != -1:
+ if string.find(c[1], '%') != -1 or string.find(c[0], '%') != -1:
printError(pkg, 'percent-in-conflicts', c[0], c[1])
+ for c in pkg.supplements():
+ if string.find(c[1], '%') != -1 or string.find(c[0], '%') != -1:
+ printError(pkg, 'percent-in-supplements', c[0], c[1])
+
+ for c in pkg.suggests():
+ if string.find(c[1], '%') != -1 or string.find(c[0], '%') != -1:
+ printError(pkg, 'percent-in-suggests', c[0], c[1])
+
+ for c in pkg.enhances():
+ if string.find(c[1], '%') != -1 or string.find(c[0], '%') != -1:
+ printError(pkg, 'percent-in-enhances', c[0], c[1])
+
+ for c in pkg.recommends():
+ if string.find(c[1], '%') != -1 or string.find(c[0], '%') != -1:
+ printError(pkg, 'percent-in-recommends', c[0], c[1])
+
expected='%s-%s-%s.%s.rpm' % (name, version, release, pkg.arch)
basename=string.split(pkg.filename, '/')[-1]
if basename != expected:
@@ -897,6 +925,10 @@
'''This package provides 2 times the same capacity. It should only provide it
once.''',
+'unversioned-explicit-self-provides',
+'''This package provides it's own name explicitely, which might break
+upgrade path. self-provides are autogenerated. Remove the provide.''',
+
'obsolete-on-name',
'''A package should not obsolete itself, as it can cause weird errors in tools.''',
Nur in b/rpmlint-0.85: TagsCheck.py.rej.

View File

@ -1,20 +0,0 @@
--- FilesCheck.py
+++ FilesCheck.py
@@ -971,7 +971,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
if not perl_dep_error:
res=perl_regex.search(f)
- if res:
+ if res and not pkg.name in ('perl', 'perl-base'):
if perl_version_trick:
vers = res.group(1) + '.' + res.group(2)
else:
@@ -981,7 +981,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
printError(pkg, 'no-dependency-on', 'perl-base', vers)
perl_dep_error=1
- if not python_dep_error:
+ if not python_dep_error and not pkg.name in ('python', 'python-base'):
res=python_regex.search(f)
if res:
if not (pkg.check_versioned_dep('python-base', res.group(1)) or

View File

@ -1,12 +1,18 @@
Index: BinariesCheck.py From 44ff92a4575956ffdcef5b3aad6ffa284b9f2282 Mon Sep 17 00:00:00 2001
=================================================================== From: Some One <nobody@opensuse.org>
--- BinariesCheck.py.orig Date: Thu, 9 Apr 2015 14:55:38 +0200
+++ BinariesCheck.py Subject: [PATCH] suse-binarieschecks.diff
@@ -9,13 +9,15 @@
import re ===================================================================
import stat ---
+import os BinariesCheck.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 56 insertions(+), 2 deletions(-)
diff --git a/BinariesCheck.py b/BinariesCheck.py
index 4634eed..a74d3e3 100644
--- a/BinariesCheck.py
+++ b/BinariesCheck.py
@@ -14,7 +14,7 @@ import sys
import rpm import rpm
@ -15,11 +21,7 @@ Index: BinariesCheck.py
import AbstractCheck import AbstractCheck
import Config import Config
import Pkg import Pkg
+import os @@ -46,6 +46,9 @@ class BinaryInfo:
DEFAULT_SYSTEM_LIB_PATHS = (
@@ -42,6 +44,9 @@ class BinaryInfo:
unused_regex = re.compile('^\s+(\S+)') unused_regex = re.compile('^\s+(\S+)')
exit_call_regex = create_regexp_call('_?exit') exit_call_regex = create_regexp_call('_?exit')
fork_call_regex = create_regexp_call('fork') fork_call_regex = create_regexp_call('fork')
@ -27,9 +29,9 @@ Index: BinariesCheck.py
+ symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+') + symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+')
+ gethostbyname_call_regex = re.compile('\s+FUNC\s+.*?\s+(gethostbyname(?:@\S+)?)(?:\s|$)') + gethostbyname_call_regex = re.compile('\s+FUNC\s+.*?\s+(gethostbyname(?:@\S+)?)(?:\s|$)')
# regexp for setgid setegid setresgid set(?:res|e)?gid # regexp for setgid setegid setresgid set(?:res|e)?gid
setgid_call_regex = create_regexp_call(['setresgid','setegid','setgid']) setgid_call_regex = create_regexp_call(['setresgid', 'setegid', 'setgid'])
setuid_call_regex = create_regexp_call(['setresuid','seteuid','setuid']) setuid_call_regex = create_regexp_call(['setresuid', 'seteuid', 'setuid'])
@@ -62,7 +67,10 @@ class BinaryInfo: @@ -66,7 +69,10 @@ class BinaryInfo:
self.stack = False self.stack = False
self.exec_stack = False self.exec_stack = False
self.exit_calls = [] self.exit_calls = []
@ -40,7 +42,7 @@ Index: BinariesCheck.py
self.tail = '' self.tail = ''
self.setgid = False self.setgid = False
@@ -131,6 +139,11 @@ class BinaryInfo: @@ -135,6 +141,11 @@ class BinaryInfo:
self.exec_stack = True self.exec_stack = True
continue continue
@ -52,7 +54,7 @@ Index: BinariesCheck.py
if is_shlib: if is_shlib:
r = BinaryInfo.exit_call_regex.search(l) r = BinaryInfo.exit_call_regex.search(l)
if r: if r:
@@ -141,6 +154,14 @@ class BinaryInfo: @@ -145,6 +156,14 @@ class BinaryInfo:
fork_called = True fork_called = True
continue continue
@ -67,7 +69,7 @@ Index: BinariesCheck.py
if self.non_pic: if self.non_pic:
self.non_pic = 'TEXTREL' in res[1] self.non_pic = 'TEXTREL' in res[1]
@@ -330,13 +351,26 @@ class BinariesCheck(AbstractCheck.Abstra @@ -339,13 +358,26 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
continue continue
# stripped ? # stripped ?
@ -95,7 +97,7 @@ Index: BinariesCheck.py
if is_shlib: if is_shlib:
has_lib = True has_lib = True
@@ -386,6 +420,10 @@ class BinariesCheck(AbstractCheck.Abstra @@ -396,6 +428,10 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
for ec in bin_info.exit_calls: for ec in bin_info.exit_calls:
printWarning(pkg, 'shared-lib-calls-exit', fname, ec) printWarning(pkg, 'shared-lib-calls-exit', fname, ec)
@ -106,7 +108,7 @@ Index: BinariesCheck.py
# rpath ? # rpath ?
if bin_info.rpath: if bin_info.rpath:
for p in bin_info.rpath: for p in bin_info.rpath:
@@ -590,6 +628,14 @@ with the intended shared libraries only. @@ -603,6 +639,14 @@ with the intended shared libraries only.''',
'ldd-failed', 'ldd-failed',
'''Executing ldd on this file failed, all checks could not be run.''', '''Executing ldd on this file failed, all checks could not be run.''',
@ -121,7 +123,7 @@ Index: BinariesCheck.py
'executable-stack', 'executable-stack',
'''The binary declares the stack as executable. Executable stack is usually an '''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 error as it is only needed if the code contains GCC trampolines or similar
@@ -602,6 +648,10 @@ don\'t define a proper .note.GNU-stack s @@ -615,6 +659,10 @@ don\'t define a proper .note.GNU-stack section.''',
make the stack executable. Usual suspects include use of a non-GNU linker or make the stack executable. Usual suspects include use of a non-GNU linker or
an old GNU linker version.''', an old GNU linker version.''',
@ -132,7 +134,7 @@ Index: BinariesCheck.py
'shared-lib-calls-exit', 'shared-lib-calls-exit',
'''This library package calls exit() or _exit(), probably in a non-fork() '''This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library context. Doing so from a library is strongly discouraged - when a library
@@ -620,6 +670,12 @@ that use prelink, make sure that prelink @@ -633,6 +681,12 @@ 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 placing a blacklist file in /etc/prelink.conf.d. For more information, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''', http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''',

View File

@ -1,25 +0,0 @@
--- BinariesCheck.py
+++ BinariesCheck.py
@@ -56,10 +56,11 @@
self.debuginfo=0
self.symtab=0
self.tail = ''
+ self.compileOpts = set()
is_debug=BinaryInfo.debug_file_regex.search(path)
- cmd = ['env', 'LC_ALL=C', 'readelf', '-W', '-S', '-l', '-d', '-s']
+ cmd = ['env', 'LC_ALL=C', 'readelf', '-W', '-S', '-l', '-d', '-s', '-p', '.comment.SUSE.OPTs']
cmd.append(path)
res = Pkg.getstatusoutput(cmd)
if not res[0]:
@@ -115,6 +116,9 @@
self.symtab=1
continue
+ if l.lower().find(" ospwg") != -1:
+ self.compileOpts.add(l.rpartition(' ')[2])
+
if self.non_pic:
self.non_pic=BinaryInfo.non_pic_regex.search(res[1])

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From e9849cceb327c1a6ebf6d0a4ba0cf15d3256776c Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] suse-check-optional-dependencies.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 28 ++++++++++++++++++++++++++++
@@ -908,6 +908,16 @@ class FilesCheck(AbstractCheck.AbstractC 1 file changed, 28 insertions(+)
diff --git a/FilesCheck.py b/FilesCheck.py
index ae9c364..7d2b92f 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -926,6 +926,16 @@ class FilesCheck(AbstractCheck.AbstractCheck):
if res.group(1) != pkg.name: if res.group(1) != pkg.name:
printError(pkg, 'incoherent-logrotate-file', f) printError(pkg, 'incoherent-logrotate-file', f)
@ -19,7 +29,7 @@ Index: FilesCheck.py
if link != '': if link != '':
ext = compr_regex.search(link) ext = compr_regex.search(link)
if ext: if ext:
@@ -1730,6 +1740,24 @@ consequences), or other compiler flags w @@ -1717,6 +1727,24 @@ consequences), or other compiler flags which result in rpmbuild's debuginfo
extraction not working as expected. Verify that the binaries are not extraction not working as expected. Verify that the binaries are not
unexpectedly stripped and that the intended compiler flags are used.''', unexpectedly stripped and that the intended compiler flags are used.''',

View File

@ -1,7 +1,17 @@
Index: Config.py From 80b89c397099061098a00df263ad3c451f2beaf0 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:37 +0200
Subject: [PATCH] suse-checks.diff
=================================================================== ===================================================================
--- Config.py.orig ---
+++ Config.py Config.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Config.py b/Config.py
index ac3c5ea..f27607c 100644
--- a/Config.py
+++ b/Config.py
@@ -16,14 +16,13 @@ try: @@ -16,14 +16,13 @@ try:
except ImportError: except ImportError:
__version__ = 'devel' __version__ = 'devel'

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From 183222dd3232a4f6d8cde5b4b66aa4c49986bdc4 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] suse-filesystem.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 454 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
@@ -103,24 +103,415 @@ STANDARD_DIRS = ( 1 file changed, 437 insertions(+), 17 deletions(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 1a70779..9532011 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -102,24 +102,415 @@ STANDARD_DIRS = (
'/usr/local/man/mann', '/usr/local/man/mann',
'/usr/local/sbin', '/usr/local/sbin',
'/usr/local/share', '/usr/local/share',
@ -429,7 +439,7 @@ Index: FilesCheck.py
'/usr/share/man', '/usr/share/man',
'/usr/share/man/man1', '/usr/share/man/man1',
'/usr/share/man/man2', '/usr/share/man/man2',
@@ -132,28 +523,57 @@ STANDARD_DIRS = ( @@ -131,25 +522,54 @@ STANDARD_DIRS = (
'/usr/share/man/man8', '/usr/share/man/man8',
'/usr/share/man/man9', '/usr/share/man/man9',
'/usr/share/man/mann', '/usr/share/man/mann',
@ -473,14 +483,11 @@ Index: FilesCheck.py
+ '/var/lib/nobody', + '/var/lib/nobody',
+ '/var/lib/pam_devperm', + '/var/lib/pam_devperm',
+ '/var/lib/wwwrun', + '/var/lib/wwwrun',
'/var/lock',
'/var/lock/subsys',
'/var/log', '/var/log',
'/var/mail', '/var/mail',
- '/var/nis', - '/var/nis',
'/var/opt', '/var/opt',
- '/var/preserve', - '/var/preserve',
'/var/run',
'/var/spool', '/var/spool',
+ '/var/spool/clientmqueue', + '/var/spool/clientmqueue',
+ '/var/spool/locks', + '/var/spool/locks',

View File

@ -1,8 +1,18 @@
Index: Config.py From 33fa1e8f8c1917d82d26c419321efb7ba9eddc48 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] suse-filter-exception.diff
=================================================================== ===================================================================
--- Config.py.orig ---
+++ Config.py Config.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
@@ -102,11 +102,23 @@ def getOption(name, default = ""): 1 file changed, 54 insertions(+), 7 deletions(-)
diff --git a/Config.py b/Config.py
index f27607c..b4e19cc 100644
--- a/Config.py
+++ b/Config.py
@@ -111,12 +111,23 @@ def getOption(name, default=""):
_filters = [] _filters = []
_filters_re = None _filters_re = None
@ -11,7 +21,7 @@ Index: Config.py
+ +
+_filters_except = [] +_filters_except = []
+_filters_except_re = None +_filters_except_re = None
+
def addFilter(s): def addFilter(s):
global _filters_re global _filters_re
+ global _filters_except + global _filters_except
@ -26,10 +36,10 @@ Index: Config.py
- _filters.append(s) - _filters.append(s)
- _filters_re = None - _filters_re = None
def removeFilter(s): def removeFilter(s):
global _filters_re @@ -133,8 +144,13 @@ _scoring = {}
@@ -121,19 +133,38 @@ def removeFilter(s):
_scoring = {}
def setBadness(s, score): def setBadness(s, score):
+ global _scoring + global _scoring
@ -39,11 +49,11 @@ Index: Config.py
+ global _filters_except + global _filters_except
+ +
+ _filters_except.append(s) + _filters_except.append(s)
+
def badness(s): def badness(s):
return _scoring.get(s, 0) return _scoring.get(s, 0)
@@ -144,11 +160,24 @@ _non_named_group_re = re.compile('[^\\](\()[^:]')
_non_named_group_re = re.compile('[^\\](\()[^:]')
def isFiltered(s): def isFiltered(s):
global _filters_re global _filters_re
+ global _filters_except + global _filters_except
@ -51,7 +61,7 @@ Index: Config.py
+ global _filters_non_except + global _filters_non_except
+ global _filters_non_except_re + global _filters_non_except_re
- if _filters_re == None: - if _filters_re is None:
- # no filter - # no filter
- if len(_filters) == 0: - if len(_filters) == 0:
- return False - return False
@ -71,8 +81,8 @@ Index: Config.py
_filters_re = '(?:' + _filters[0] + ')' _filters_re = '(?:' + _filters[0] + ')'
for idx in range(1, len(_filters)): for idx in range(1, len(_filters)):
@@ -145,9 +176,27 @@ def isFiltered(s): @@ -160,9 +189,27 @@ def isFiltered(s):
_filters_re = _filters_re + '|(?:' + _filters[idx] +')' _filters_re = _filters_re + '|(?:' + _filters[idx] + ')'
_filters_re = re.compile(_filters_re) _filters_re = re.compile(_filters_re)
+ if _filters_except_re == None and len(_filters_except): + if _filters_except_re == None and len(_filters_except):

View File

@ -1,7 +1,17 @@
Index: Config.py From 901114eb2ec05cbf2ad16557f0d24cfbc6e8717f Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] suse-filter-more-verbose.diff
=================================================================== ===================================================================
--- Config.py.orig ---
+++ Config.py Config.py | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/Config.py b/Config.py
index b4e19cc..c29db24 100644
--- a/Config.py
+++ b/Config.py
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
import locale import locale
import os.path import os.path
@ -10,7 +20,7 @@ Index: Config.py
try: try:
from __version__ import __version__ from __version__ import __version__
@@ -162,7 +163,17 @@ def isFiltered(s): @@ -175,7 +176,17 @@ def isFiltered(s):
if '(' in _filters_non_except[idx]: if '(' in _filters_non_except[idx]:
_non_named_group_re.subn('(:?', _filters_non_except[idx]) _non_named_group_re.subn('(:?', _filters_non_except[idx])
_filters_non_except_re = _filters_non_except_re + '|(?:' + _filters_non_except[idx] +')' _filters_non_except_re = _filters_non_except_re + '|(?:' + _filters_non_except[idx] +')'
@ -29,10 +39,10 @@ Index: Config.py
if _filters_re == None and len(_filters): if _filters_re == None and len(_filters):
_filters_re = '(?:' + _filters[0] + ')' _filters_re = '(?:' + _filters[0] + ')'
@@ -174,7 +185,17 @@ def isFiltered(s): @@ -187,7 +198,17 @@ def isFiltered(s):
if '(' in _filters[idx]: if '(' in _filters[idx]:
_non_named_group_re.subn('(:?', _filters[idx]) _non_named_group_re.subn('(:?', _filters[idx])
_filters_re = _filters_re + '|(?:' + _filters[idx] +')' _filters_re = _filters_re + '|(?:' + _filters[idx] + ')'
- _filters_re = re.compile(_filters_re) - _filters_re = re.compile(_filters_re)
+ try: + try:
+ _filters_re = re.compile(_filters_re) + _filters_re = re.compile(_filters_re)

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From 63be0917d8528f33739c7360631a3a69fa22186c Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] suse-g-ir-chech.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 2 +-
@@ -599,7 +599,7 @@ points_regex = re.compile('^\.\./(.*)') 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 1b68dd5..0bb4b3d 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -607,7 +607,7 @@ points_regex = re.compile('^\.\./(.*)')
doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help') doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help')
bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)')
includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE)

View File

@ -1,10 +1,20 @@
Index: SpecCheck.py From 70405312535d40c4d3489834af7a1676b10a63ae Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] suse-ignore-specfile-errors.diff
=================================================================== ===================================================================
--- SpecCheck.py.orig ---
+++ SpecCheck.py SpecCheck.py | 5 ++---
@@ -537,9 +537,8 @@ class SpecCheck(AbstractCheck.AbstractCh 1 file changed, 2 insertions(+), 3 deletions(-)
printWarning(pkg, "patch-not-applied", "Patch%d:" % pnum,
pfile) diff --git a/SpecCheck.py b/SpecCheck.py
index 60e946b..ace044c 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -562,9 +562,8 @@ class SpecCheck(AbstractCheck.AbstractCheck):
printWarning(pkg, "patch-not-applied",
"Patch%d:" % pnum, pfile)
- # Rest of the checks require a real spec file - # Rest of the checks require a real spec file
- if not self._spec_file: - if not self._spec_file:

View File

@ -0,0 +1,23 @@
From 9d8086e75306f2e90ba402514a6c53da507c0467 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] suse-manpages-for-rc-scripts
===================================================================
---
FilesCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 214ac76..5342871 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -1426,7 +1426,7 @@ class FilesCheck(AbstractCheck.AbstractCheck):
for exe, paths in bindir_exes.items():
if len(paths) > 1:
printWarning(pkg, "duplicate-executable", exe, paths)
- if exe not in man_basenames:
+ if exe not in man_basenames and not exe.startswith("rc") and len(paths) is not 0:
printWarning(pkg, "no-manual-page-for-binary", exe)
# Create an object to enable the auto registration of the test

View File

@ -1,32 +0,0 @@
--- TagsCheck.py
+++ TagsCheck.py
@@ -686,6 +686,17 @@ class TagsCheck(AbstractCheck.AbstractCheck):
for p in useless_provides:
printError(pkg, 'useless-explicit-provides',p)
+ have_mono_reqs=False
+ for r in req_names + prov_names:
+ if r.startswith('mono('):
+ have_mono_reqs=True
+ break
+
+ if not have_mono_reqs:
+ for fname in pkg.files():
+ if fname.endswith('.dll'):
+ printError(pkg, 'mono-versioned-deps-missing', fname)
+
useless_reqs=set()
for r in reqs:
if not r in useless_reqs:
@@ -901,6 +912,11 @@ upgrade path. self-provides are autogenerated. Remove the provide.''',
'obsolete-on-name',
'''A package should not obsolete itself, as it can cause weird errors in tools.''',
+'mono-versioned-deps-missing',
+'''This package appears to be related to mono, but doesn't have versioned
+mono provides being generated. Add mono-devel to the buildrequires to
+build the package with the correct provides.''',
+
'invalid-filepath-dependency',
'''A package has a file or path based dependency that is not resolveable for
package solvers because it is not in the whitelist for path based dependencies

View File

@ -1,9 +1,19 @@
Index: SpecCheck.py From cc1c035a8d572cd0005d999e4e1f3dc76a31efd4 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] suse-no-run-ldconfig.diff
=================================================================== ===================================================================
--- SpecCheck.py.orig ---
+++ SpecCheck.py SpecCheck.py | 12 ++++++++++++
@@ -424,6 +424,10 @@ class SpecCheck(AbstractCheck.AbstractCh 1 file changed, 12 insertions(+)
printWarning(pkg, 'comparison-operator-in-deptoken',
diff --git a/SpecCheck.py b/SpecCheck.py
index 63897f2..12b6f2b 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -448,6 +448,10 @@ class SpecCheck(AbstractCheck.AbstractCheck):
'comparison-operator-in-deptoken',
conf) conf)
+ if current_section in ('post', 'postun'): + if current_section in ('post', 'postun'):
@ -13,7 +23,7 @@ Index: SpecCheck.py
if current_section == 'changelog': if current_section == 'changelog':
for match in AbstractCheck.macro_regex.findall(line): for match in AbstractCheck.macro_regex.findall(line):
res = re.match('%+', match) res = re.match('%+', match)
@@ -748,6 +752,14 @@ may break short circuit builds.''', @@ -773,6 +777,14 @@ may break short circuit builds.''',
'''Make check or other automated regression test should be run in %check, as '''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.''', they can be disabled with a rpm macro for short circuiting purposes.''',

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From ef47fdf1ddf38ef1ff48b31242a75955042f468f Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] suse-pkg-config-check.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 19 ++++++++++++++++++-
@@ -415,6 +415,7 @@ lib_devel_number_regex = re.compile('^li 1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/TagsCheck.py b/TagsCheck.py
index d49239f..0a56b7d 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -416,6 +416,7 @@ lib_devel_number_regex = re.compile('^lib(.*?)([0-9.]+)(_[0-9.]+)?-devel')
invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE) invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE)
lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE) lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE)
leading_space_regex = re.compile('^\s+') leading_space_regex = re.compile('^\s+')
@ -10,7 +20,7 @@ Index: TagsCheck.py
license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s') license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s')
invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
# () are here for grouping purpose in the regexp # () are here for grouping purpose in the regexp
@@ -626,10 +627,12 @@ class TagsCheck(AbstractCheck.AbstractCh @@ -634,10 +635,12 @@ class TagsCheck(AbstractCheck.AbstractCheck):
base = is_devel.group(1) base = is_devel.group(1)
dep = None dep = None
has_so = False has_so = False
@ -24,7 +34,7 @@ Index: TagsCheck.py
if has_so: if has_so:
base_or_libs = base + '/' + base + '-libs/lib' + base base_or_libs = base + '/' + base + '-libs/lib' + base
# try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)") # try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)")
@@ -666,6 +669,15 @@ class TagsCheck(AbstractCheck.AbstractCh @@ -674,6 +677,15 @@ class TagsCheck(AbstractCheck.AbstractCheck):
if prov not in (x[0] for x in pkg.provides()): if prov not in (x[0] for x in pkg.provides()):
printWarning(pkg, 'no-provides', prov) printWarning(pkg, 'no-provides', prov)
@ -40,7 +50,7 @@ Index: TagsCheck.py
# List of words to ignore in spell check # List of words to ignore in spell check
ignored_words = set() ignored_words = set()
for pf in pkg.files(): for pf in pkg.files():
@@ -1099,6 +1111,11 @@ once.''', @@ -1112,6 +1124,11 @@ once.''',
'no-url-tag', 'no-url-tag',
'''The URL tag is missing. Please add a http or ftp link to the project location.''', '''The URL tag is missing. Please add a http or ftp link to the project location.''',

View File

@ -1,8 +1,18 @@
Index: FilesCheck.py From ebde573491954aa965530c0147d00d4f3400a647 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] suse-python-abi-check.diff
=================================================================== ===================================================================
--- FilesCheck.py.orig ---
+++ FilesCheck.py FilesCheck.py | 7 +++++--
@@ -1110,8 +1110,11 @@ class FilesCheck(AbstractCheck.AbstractC 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index acb379f..214ac76 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -1129,8 +1129,11 @@ class FilesCheck(AbstractCheck.AbstractCheck):
if res and not (pkg.check_versioned_dep('python-base', if res and not (pkg.check_versioned_dep('python-base',
res.group(1)) or res.group(1)) or
pkg.check_versioned_dep('python', pkg.check_versioned_dep('python',

View File

@ -1,7 +1,17 @@
Index: NamingPolicyCheck.py From 04dd83f02896ad46f4db5b6115e18eb80a5e8bdf Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:37 +0200
Subject: [PATCH] suse-python3-naming-policy.diff
=================================================================== ===================================================================
--- NamingPolicyCheck.py.orig ---
+++ NamingPolicyCheck.py NamingPolicyCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/NamingPolicyCheck.py b/NamingPolicyCheck.py
index 231b936..96fb91d 100644
--- a/NamingPolicyCheck.py
+++ b/NamingPolicyCheck.py
@@ -90,7 +90,7 @@ check = NamingPolicyCheck() @@ -90,7 +90,7 @@ check = NamingPolicyCheck()

View File

@ -1,11 +0,0 @@
--- InitScriptCheck.py
+++ InitScriptCheck.py
@@ -105,7 +105,7 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
# TODO: where is it specified that these (or some)
# keywords are mandatory?
- for i in ('Provides', 'Description', 'Short-Description'):
+ for i in ('Provides', 'Required-Start', 'Required-Stop', 'Default-Start'):
if i not in lsb_tags.keys():
printError(pkg, 'missing-mandatory-lsb-keyword', "%s in %s" % (i, f))
if in_lsb_tag:

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From f32933089f8ee5df3c918bc031d41a143624f7b9 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] suse-shlib-devel-dependency.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 4 ++--
@@ -639,10 +639,10 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/TagsCheck.py b/TagsCheck.py
index 18cbb6e..fc392e5 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -642,10 +642,10 @@ class TagsCheck(AbstractCheck.AbstractCheck):
if pkg_config_regex.match(fname) and fname.endswith('.pc'): if pkg_config_regex.match(fname) and fname.endswith('.pc'):
has_pc = True has_pc = True
if has_so: if has_so:

View File

@ -1,8 +1,18 @@
Index: SpecCheck.py From bfd4f480818bccedf8c5a7c45eeaa35f0968c27a Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] suse-speccheck-utf8.diff
=================================================================== ===================================================================
--- SpecCheck.py.orig ---
+++ SpecCheck.py SpecCheck.py | 4 ++--
@@ -625,8 +625,8 @@ SPEC file to build a valid RPM package.' 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/SpecCheck.py b/SpecCheck.py
index d0d381a..60e946b 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -650,8 +650,8 @@ SPEC file to build a valid RPM package.''',
("Name:" tag). Either rename your package or the specfile.''', ("Name:" tag). Either rename your package or the specfile.''',
'non-utf8-spec-file', 'non-utf8-spec-file',

View File

@ -0,0 +1,79 @@
From 738e37c34c66a665012bcf6b123b81717c16d3f3 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Fri, 10 Apr 2015 14:38:22 +0200
Subject: [PATCH] suse sysv init checks
we don't use chkconfig but have different macros
---
InitScriptCheck.py | 44 ++++++++++++++++++++++++++++++--------------
1 file changed, 30 insertions(+), 14 deletions(-)
diff --git a/InitScriptCheck.py b/InitScriptCheck.py
index fb53d93..1a58562 100644
--- a/InitScriptCheck.py
+++ b/InitScriptCheck.py
@@ -36,6 +36,10 @@ LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start',
RECOMMENDED_LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop',
'Default-Stop', 'Short-Description')
+suse = True
+stop_on_removal_regex=re.compile('bin/systemctl stop \$service >/dev/null')
+restart_on_update_regex=re.compile('bin/systemctl try-restart \$service >/dev/null')
+insserv_cleanup_regex=re.compile('^\s*/sbin/insserv /etc/init.d$', re.MULTILINE)
class InitScriptCheck(AbstractCheck.AbstractCheck):
@@ -44,6 +48,12 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
def check_binary(self, pkg):
initscript_list = []
+
+ # check chkconfig call in %post and %preun
+ postin = Pkg.b2s(pkg[rpm.RPMTAG_POSTIN]) or pkg.scriptprog(rpm.RPMTAG_POSTINPROG)
+ preun = Pkg.b2s(pkg[rpm.RPMTAG_PREUN]) or pkg.scriptprog(rpm.RPMTAG_PREUNPROG)
+ postun = Pkg.b2s(pkg[rpm.RPMTAG_POSTUN]) or pkg.scriptprog(rpm.RPMTAG_POSTUNPROG)
+
for fname, pkgfile in pkg.files().items():
if not fname.startswith('/etc/init.d/') and \
@@ -61,20 +71,26 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
if "." in basename:
printError(pkg, 'init-script-name-with-dot', fname)
- # check chkconfig call in %post and %preun
- postin = Pkg.b2s(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.b2s(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 suse:
+ if not postin:
+ printError(pkg, 'init-script-without-chkconfig-postin', fname)
+ elif not chkconfig_regex.search(postin):
+ printError(pkg, 'postin-without-chkconfig', fname)
+
+ if not preun:
+ printError(pkg, 'init-script-without-chkconfig-preun', fname)
+ elif not chkconfig_regex.search(preun):
+ printError(pkg, 'preun-without-chkconfig', fname)
+
+ else:
+ if not preun or not stop_on_removal_regex.search(preun):
+ printError(pkg, 'init-script-without-%stop_on_removal-preun', fname)
+
+ if not postun or not restart_on_update_regex.search(postun):
+ printError(pkg, 'init-script-without-%restart_on_update-postun', fname)
+
+ if not postun or not insserv_cleanup_regex.search(postun):
+ printError(pkg, 'init-script-without-%insserv_cleanup-postun', fname)
status_found = False
reload_found = False

View File

@ -1,17 +1,27 @@
Index: TagsCheck.py From 3c022dc151d18c32c2d3a7f3efdaed0d8ed39245 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:37 +0200
Subject: [PATCH] suse-url-check.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 4 ++--
@@ -781,7 +781,7 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/TagsCheck.py b/TagsCheck.py
index fa38a07..d49239f 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -794,7 +794,7 @@ class TagsCheck(AbstractCheck.AbstractCheck):
if not valid_license: if not valid_license:
self._unexpanded_macros(pkg, 'License', rpm_license) self._unexpanded_macros(pkg, 'License', rpm_license)
- for tag in ('URL', 'DistURL', 'BugURL'): - for tag in ('URL', 'DistURL', 'BugURL'):
+ for tag in ('URL', 'BugURL'): + for tag in ('URL', 'BugURL'):
if hasattr(rpm, 'RPMTAG_%s' % tag.upper()): if hasattr(rpm, 'RPMTAG_%s' % tag.upper()):
url = pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())] url = Pkg.b2s(pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())])
self._unexpanded_macros(pkg, tag, url, is_url = True) self._unexpanded_macros(pkg, tag, url, is_url=True)
@@ -1097,7 +1097,7 @@ once.''', @@ -1110,7 +1110,7 @@ once.''',
'''This rpm requires a specific release of another package.''', '''This rpm requires a specific release of another package.''',
'no-url-tag', 'no-url-tag',

View File

@ -1,16 +1,26 @@
Index: SpecCheck.py From 79b3a5168fc9e2be4f74624a63721e6b77c40020 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:37 +0200
Subject: [PATCH] suse-version.diff
=================================================================== ===================================================================
--- SpecCheck.py.orig ---
+++ SpecCheck.py SpecCheck.py | 16 ++++++++++++++++
@@ -66,6 +66,7 @@ libdir_regex = re.compile('%{?_lib(?:dir 1 file changed, 16 insertions(+)
diff --git a/SpecCheck.py b/SpecCheck.py
index 2b24b43..9ea5c6e 100644
--- a/SpecCheck.py
+++ b/SpecCheck.py
@@ -66,6 +66,7 @@ libdir_regex = re.compile('%{?_lib(?:dir)?\}?\\b')
comment_or_empty_regex = re.compile('^\s*(#|$)') comment_or_empty_regex = re.compile('^\s*(#|$)')
defattr_regex = re.compile('^\s*%defattr\\b') defattr_regex = re.compile('^\s*%defattr\\b')
attr_regex = re.compile('^\s*%attr\\b') attr_regex = re.compile('^\s*%attr\\b')
+suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)') +suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)')
section_regexs = dict( section_regexs = dict(
([x, re.compile('^%' + x + '(?:\s|$)')] ([x, re.compile('^%' + x + '(?:\s|$)')]
for x in ['build', 'changelog', 'check', 'clean', 'description', 'files', for x in ('build', 'changelog', 'check', 'clean', 'description', 'files',
@@ -369,6 +370,12 @@ class SpecCheck(AbstractCheck.AbstractCh @@ -387,6 +388,12 @@ class SpecCheck(AbstractCheck.AbstractCheck):
if not res.group(1).startswith('%'): if not res.group(1).startswith('%'):
printWarning(pkg, 'hardcoded-prefix-tag', res.group(1)) printWarning(pkg, 'hardcoded-prefix-tag', res.group(1))
@ -23,7 +33,7 @@ Index: SpecCheck.py
res = prereq_regex.search(line) res = prereq_regex.search(line)
if res: if res:
printError(pkg, 'prereq-use', res.group(2)) printError(pkg, 'prereq-use', res.group(2))
@@ -790,6 +797,15 @@ in the resulting binary package dependin @@ -815,6 +822,15 @@ in the resulting binary package depending on the build environment and rpmbuild
version (typically < 4.4). Add default attributes using %defattr before it in version (typically < 4.4). Add default attributes using %defattr before it in
the %files section, or use per entry %attr's.''', the %files section, or use per entry %attr's.''',

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From 7157c6617f37aae4fd6a0cc3da3f9620b52a1b59 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:40 +0200
Subject: [PATCH] suse-whitelist-opensuse.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 2 +-
@@ -891,7 +891,7 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TagsCheck.py b/TagsCheck.py
index 40ce77a..3c68d28 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -912,7 +912,7 @@ class TagsCheck(AbstractCheck.AbstractCheck):
spell_check(pkg, utf8summary, 'Summary(%s)', lang, ignored_words) spell_check(pkg, utf8summary, 'Summary(%s)', lang, ignored_words)
if '\n' in summary: if '\n' in summary:
printError(pkg, 'summary-on-multiple-lines', lang) printError(pkg, 'summary-on-multiple-lines', lang)

View File

@ -1,76 +0,0 @@
Index: InitScriptCheck.py
===================================================================
--- InitScriptCheck.py.orig
+++ InitScriptCheck.py
@@ -30,6 +30,10 @@ lsb_tags_regex = re.compile('^# ([\w-]+)
lsb_cont_regex = re.compile('^#(?:\t| )(.*?)\s*$')
use_subsys = Config.getOption('UseVarLockSubsys', True)
+stop_on_removal_regex=re.compile('bin/systemctl stop \$service >/dev/null')
+restart_on_update_regex=re.compile('bin/systemctl try-restart \$service >/dev/null')
+insserv_cleanup_regex=re.compile('^\s*/sbin/insserv /etc/init.d$', re.MULTILINE)
+
LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start',
'Should-Stop', 'Default-Start', 'Default-Stop',
'Short-Description', 'Description')
@@ -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.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,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.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.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)
+
+ if not postun or not restart_on_update_regex.search(postun):
+ printError(pkg, 'init-script-without-%restart_on_update-postun', fname)
+
+ if not postun or not insserv_cleanup_regex.search(postun):
+ printError(pkg, 'init-script-without-%insserv_cleanup-postun', fname)
status_found = False
reload_found = False
@@ -276,6 +283,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.''',
+
+'init-script-without-%stop_on_removal-preun',
+'''The init script should have a %preun script that calls %stop_on_removal.''',
+
+'init-script-without-%insserv_cleanup-postun',
+'''The package 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

@ -1,16 +1,26 @@
Index: BinariesCheck.py From 20d0203074b713a337cad87d8db5713bcc0bbf63 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] usr-arch.diff
=================================================================== ===================================================================
--- BinariesCheck.py.orig ---
+++ BinariesCheck.py BinariesCheck.py | 3 ++-
@@ -263,6 +263,7 @@ usr_lib_exception_regex = re.compile(Con 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/BinariesCheck.py b/BinariesCheck.py
index a74d3e3..c1c566d 100644
--- a/BinariesCheck.py
+++ b/BinariesCheck.py
@@ -270,6 +270,7 @@ usr_lib_exception_regex = re.compile(Config.getOption('UsrLibBinaryException', '
srcname_regex = re.compile('(.*?)-[0-9]') srcname_regex = re.compile('(.*?)-[0-9]')
invalid_dir_ref_regex = re.compile('/(home|tmp)(\W|$)') invalid_dir_ref_regex = re.compile('/(home|tmp)(\W|$)')
ocaml_mixed_regex = re.compile('^Caml1999X0\d\d$') ocaml_mixed_regex = re.compile('^Caml1999X0\d\d$')
+usr_arch_share_regex = re.compile('/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64|m68k|arm|aarch64)') +usr_arch_share_regex = re.compile('/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64|m68k|arm|aarch64)')
def dir_base(path): def dir_base(path):
res = path_regex.search(path) @@ -343,7 +344,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
@@ -336,7 +337,7 @@ class BinariesCheck(AbstractCheck.Abstra
# arch dependent packages only from here on # arch dependent packages only from here on
# in /usr/share ? # in /usr/share ?

View File

@ -1,105 +0,0 @@
--- SpecCheck.py
+++ SpecCheck.py
@@ -45,7 +45,8 @@
biarch_package_regex = re.compile(DEFAULT_BIARCH_PACKAGES)
hardcoded_lib_path_exceptions_regex = re.compile(Config.getOption('HardcodedLibPathExceptions', DEFAULT_HARDCODED_LIB_PATH_EXCEPTIONS))
prereq_regex = re.compile('^PreReq(\(.*\))?:\s*(.+?)\s*$', re.IGNORECASE)
-buildprereq_regex = re.compile('^BuildPreReq:\s*(.+?)\s*$', re.IGNORECASE)
+buildprereq_regex = re.compile('^BuildPreReq\s*:\s*(.+)\s*$', re.IGNORECASE)
+buildrequires_regex = re.compile('^\s*BuildRequires\s*:\s*(.+)\s*$', re.IGNORECASE)
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
macro_regex = re.compile('(%+)[{(]?(\w+)')
libdir_regex = re.compile('%{?_lib(?:dir)?\}?\\b')
@@ -126,6 +127,25 @@
res.append(tok)
return res
+def find_reverse_requires():
+ reverse_requires = dict()
+ try:
+ f = file("/.builtinfo/rpmdeps", "r")
+ except:
+ return reverse_requires
+
+ for line in f:
+ if line.startswith('R:'):
+ package = "-".join(line.split(':')[1].split('-')[:-3])
+ deps = deptokens(line.split(':')[2])
+ for dep in deps:
+ name = dep.split(' ')[0]
+ if name.startswith('/') or name.find('(') != -1 or name == dep:
+ continue
+ reverse_requires.setdefault(name, set()).add(package)
+
+ return reverse_requires
+
def contains_buildroot(line):
'''Check if the given line contains use of rpm buildroot.'''
res = rpm_buildroot_regex.search(line)
@@ -188,6 +208,8 @@
indent_tabs = 0
files_has_defattr = 0
section = {}
+ buildrequires = set()
+
for sec in ['description', 'prep', 'build', 'install', 'clean',
'files', 'changelog', 'package', 'check']:
section[sec] = {
@@ -348,6 +370,14 @@
if res:
printError(pkg, 'buildprereq-use', res.group(1))
+ res = buildrequires_regex.search(line)
+ if not if_depth and res:
+ for r in deptokens(res.group(1)):
+ name = r.split(' ')[0]
+ if name in buildrequires:
+ printWarning(pkg, 'duplicate-buildrequires', name)
+ buildrequires.add(name)
+
if scriptlet_requires_regex.search(line):
printError(pkg, 'broken-syntax-in-scriptlet-requires', string.strip(line))
@@ -420,6 +450,24 @@
'(spaces: line %d, tab: line %d)' %
(indent_spaces, indent_tabs))
+ reverse_requires = find_reverse_requires()
+ for r in buildrequires:
+ if r in reverse_requires:
+ for rev in reverse_requires[r]:
+ if rev in buildrequires:
+ printWarning(pkg, 'unnecessary-buildrequires', r, 'already included by', rev)
+
+ if not r.endswith("-devel"):
+ develr = [ r + "-devel" ]
+ # libfoo-4_2 -> libfoo-devel
+ dr2 = re.sub(r'-?[0-9_]+$', '', r) + "-devel"
+ if dr2 != develr[0]:
+ develr.append(dr2);
+ for dr in develr:
+ if r in reverse_requires and dr in reverse_requires[r] \
+ and not dr in buildrequires:
+ printWarning(pkg, "non-devel-buildrequires", r, "- did you mean", dr, "?")
+
# process gathered info
for p in patches.keys():
if p in applied_patches_ifarch:
@@ -557,6 +605,17 @@
odd entries eg. in source rpms, which is rarely wanted. Avoid use of macros
in %changelog altogether, or use two '%'s to escape them, like '%%foo'.''',
+'unnecessary-buildrequires',
+''' The specfile contains a buildrequires entry that seems to be already
+requires by one of the other buildrequires. Please consider reducing your
+buildrequires definitions in case this is a real implicit dependency.''',
+
+'non-devel-buildrequires',
+'''The specfile contains a buildrequires entry that has a -devel package.
+Please carefully check if you want to buildrequire the -devel subpackage or if
+this is an unnecessary dependency that is already required by one of the other
+buildrequires.''',
+
'depscript-without-disabling-depgen',
'''In some common rpm configurations/versions, defining __find_provides and/or
__find_requires has no effect if rpm's internal dependency generator has not

View File

@ -1,9 +1,18 @@
From b7555312b3496b9e15bae3d292fa038227c072e0 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:39 +0200
Subject: [PATCH] version-control-internal-file.diff
also detect RCS files also detect RCS files
Index: FilesCheck.py ---
=================================================================== FilesCheck.py | 2 +-
--- FilesCheck.py.orig 1 file changed, 1 insertion(+), 1 deletion(-)
+++ FilesCheck.py
@@ -612,7 +612,7 @@ ldconfig_regex = re.compile('^[^#]*ldcon diff --git a/FilesCheck.py b/FilesCheck.py
index 7d2b92f..efda328 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -620,7 +620,7 @@ ldconfig_regex = re.compile('^[^#]*ldconfig', re.MULTILINE)
depmod_regex = re.compile('^[^#]*depmod', re.MULTILINE) depmod_regex = re.compile('^[^#]*depmod', re.MULTILINE)
install_info_regex = re.compile('^[^#]*install-info', re.MULTILINE) install_info_regex = re.compile('^[^#]*install-info', re.MULTILINE)
perl_temp_file_regex = re.compile('.*perl.*/(\.packlist|perllocal\.pod)$') perl_temp_file_regex = re.compile('.*perl.*/(\.packlist|perllocal\.pod)$')

View File

@ -1,27 +0,0 @@
Index: rpmlint-1.5/MenuXDGCheck.py
===================================================================
--- rpmlint-1.5.orig/MenuXDGCheck.py
+++ rpmlint-1.5/MenuXDGCheck.py
@@ -43,13 +43,16 @@ class MenuXDGCheck(AbstractCheck.Abstrac
printError(pkg, 'non-utf8-desktopfile', filename)
self.cfp.read(f)
- binary = self.cfp.get('Desktop Entry','Exec').split(' ',1)[0]
+ binary = None
found = False
- for i in STANDARD_BIN_DIRS:
- if os.path.exists(root + i + binary):
- # no need to check if the binary is +x, rpmlint does it
- # in another place
- found = True
+ if self.cfp.has_option('Desktop Entry','Exec'):
+ binary = self.cfp.get('Desktop Entry','Exec').split(' ',1)[0]
+
+ for i in STANDARD_BIN_DIRS:
+ if os.path.exists(root + i + binary):
+ # no need to check if the binary is +x, rpmlint does it
+ # in another place
+ found = True
if not found and binary:
printWarning(pkg, 'desktopfile-without-binary', filename, binary)

View File

@ -1,10 +1,20 @@
Index: MenuXDGCheck.py From 8f5c28a5bce4c922e7b9ab62ad357b2a58e966a2 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] xdg-paths-update.diff
=================================================================== ===================================================================
--- MenuXDGCheck.py.orig ---
+++ MenuXDGCheck.py MenuXDGCheck.py | 2 +-
@@ -24,7 +24,7 @@ class MenuXDGCheck(AbstractCheck.Abstrac 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MenuXDGCheck.py b/MenuXDGCheck.py
index 4aab385..158db23 100644
--- a/MenuXDGCheck.py
+++ b/MenuXDGCheck.py
@@ -24,7 +24,7 @@ class MenuXDGCheck(AbstractCheck.AbstractFilesCheck):
# $ echo $XDG_DATA_DIRS/applications
# /var/lib/menu-xdg:/usr/share # /var/lib/menu-xdg:/usr/share
self.cfp = RawConfigParser()
AbstractCheck.AbstractFilesCheck.__init__( AbstractCheck.AbstractFilesCheck.__init__(
- self, "MenuXDGCheck", "/usr/share/applications/.*\.desktop$") - self, "MenuXDGCheck", "/usr/share/applications/.*\.desktop$")
+ self, "MenuXDGCheck", "(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$") + self, "MenuXDGCheck", "(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$")

View File

@ -1,8 +1,18 @@
Index: TagsCheck.py From 75c0cb8cc089bdbe907c776a78a296d8f1a48cf6 Mon Sep 17 00:00:00 2001
From: Some One <nobody@opensuse.org>
Date: Thu, 9 Apr 2015 14:55:38 +0200
Subject: [PATCH] yast-provides.diff
=================================================================== ===================================================================
--- TagsCheck.py.orig ---
+++ TagsCheck.py TagsCheck.py | 2 +-
@@ -821,7 +821,7 @@ class TagsCheck(AbstractCheck.AbstractCh 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TagsCheck.py b/TagsCheck.py
index 0a56b7d..9e00892 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -823,7 +823,7 @@ class TagsCheck(AbstractCheck.AbstractCheck):
printWarning(pkg, 'no-url-tag') printWarning(pkg, 'no-url-tag')
obs_names = [x[0] for x in pkg.obsoletes()] obs_names = [x[0] for x in pkg.obsoletes()]