forked from pool/rpmlint
Accepting request 38818 from Base:System
Copy from Base:System/rpmlint based on submit request 38818 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/38818 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=58
This commit is contained in:
parent
7a7cb5dedf
commit
ef72ae8a8c
@ -589,6 +589,13 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck):
|
||||
if os.path.isdir(pkg.dirName()+f):
|
||||
dirs.add(f)
|
||||
|
||||
# Verify it doesn't have hard dependency on non-lib packages
|
||||
for dep in pkg.requires():
|
||||
if (dep[0].startswith('rpmlib(')):
|
||||
continue
|
||||
if (dep[2] & (rpm.RPMSENSE_GREATER | rpm.RPMSENSE_EQUAL)) == rpm.RPMSENSE_EQUAL:
|
||||
printWarning(pkg, "shlib-fixed-dependency", Pkg.formatRequire(dep[0], dep[1], dep[2]))
|
||||
|
||||
# Verify non-lib stuff does not add dependencies
|
||||
if libs:
|
||||
for dep in pkg_requires.difference(_essential_dependencies):
|
||||
@ -638,6 +645,12 @@ a seperate one to reduce the additional dependencies for other users of this lib
|
||||
"""Your package starts with 'lib' as part of it's name, but does not provide
|
||||
any libraries. It must not be called a lib-package then. Give it a more
|
||||
sensible name.""",
|
||||
'shlib-fixed-dependency',
|
||||
"""Your shared library package requires a fixed version of another package. The
|
||||
intention of the Shared Library Policy is to allow parallel installation of
|
||||
multiple versions of the same shared library, hard dependencies likely make that
|
||||
impossible. Please remove this dependency and instead move it to the runtime uses
|
||||
of your library.""",
|
||||
'shlib-unversioned-lib',
|
||||
"""Your package matches the Shared Library Policy Naming Scheme but contains an
|
||||
unversioned library. Therefore it is very unlikely that your package can be installed
|
||||
|
1
config
1
config
@ -74,6 +74,7 @@ addFilter(".*one-line-command-in-.*")
|
||||
addFilter(" dir-or-file-in-opt")
|
||||
addFilter("incoherent-version-in-changelog")
|
||||
addFilter(" no-signature")
|
||||
addFilter(" symlink-crontab-file") #bnc591431
|
||||
addFilter(" without-chkconfig")
|
||||
addFilter("unstripped-binary-or-object.*\.ko")
|
||||
addFilter(" no-chkconfig")
|
||||
|
@ -32,8 +32,10 @@ setOption("ValidGroups", (
|
||||
"Development/Languages/C and C++" ,\
|
||||
"Development/Languages/Fortran" ,\
|
||||
"Development/Languages/Java" ,\
|
||||
"Development/Languages/Mono" ,\
|
||||
"Development/Languages/Other" ,\
|
||||
"Development/Languages/Perl" ,\
|
||||
"Development/Libraries/PHP" ,\
|
||||
"Development/Languages/Python" ,\
|
||||
"Development/Languages/Ruby" ,\
|
||||
"Development/Languages/Scheme" ,\
|
||||
@ -59,8 +61,8 @@ setOption("ValidGroups", (
|
||||
"Development/Tools/Navigators" ,\
|
||||
"Development/Tools/Other" ,\
|
||||
"Development/Tools/Version Control" ,\
|
||||
"Documentation/Howto" ,\
|
||||
"Documentation/HTML" ,\
|
||||
"Documentation/Howto" ,\
|
||||
"Documentation/Man" ,\
|
||||
"Documentation/Other" ,\
|
||||
"Documentation/SuSE" ,\
|
||||
@ -87,6 +89,9 @@ setOption("ValidGroups", (
|
||||
"Productivity/Databases/Clients" ,\
|
||||
"Productivity/Databases/Servers" ,\
|
||||
"Productivity/Databases/Tools" ,\
|
||||
"Productivity/Editors/Emacs" ,\
|
||||
"Productivity/Editors/Other" ,\
|
||||
"Productivity/Editors/Vi" ,\
|
||||
"Productivity/File utilities" ,\
|
||||
"Productivity/Graphics/3D Editors" ,\
|
||||
"Productivity/Graphics/Bitmap Editors" ,\
|
||||
@ -122,9 +127,9 @@ setOption("ValidGroups", (
|
||||
"Productivity/Networking/Boot/Clients" ,\
|
||||
"Productivity/Networking/Boot/Servers" ,\
|
||||
"Productivity/Networking/Boot/Utilities" ,\
|
||||
"Productivity/Networking/Diagnostic" ,\
|
||||
"Productivity/Networking/DNS/Servers" ,\
|
||||
"Productivity/Networking/DNS/Utilities" ,\
|
||||
"Productivity/Networking/Diagnostic" ,\
|
||||
"Productivity/Networking/Email/Clients" ,\
|
||||
"Productivity/Networking/Email/Mailinglists" ,\
|
||||
"Productivity/Networking/Email/Servers" ,\
|
||||
@ -133,26 +138,26 @@ setOption("ValidGroups", (
|
||||
"Productivity/Networking/Ftp/Clients" ,\
|
||||
"Productivity/Networking/Ftp/Servers" ,\
|
||||
"Productivity/Networking/ICQ" ,\
|
||||
"Productivity/Networking/Instant Messenger" ,\
|
||||
"Productivity/Networking/IRC" ,\
|
||||
"Productivity/Networking/Instant Messenger" ,\
|
||||
"Productivity/Networking/LDAP/Clients" ,\
|
||||
"Productivity/Networking/LDAP/Servers" ,\
|
||||
"Productivity/Networking/LDAP/Utilities" ,\
|
||||
"Productivity/Networking/NFS" ,\
|
||||
"Productivity/Networking/NIS" ,\
|
||||
"Productivity/Networking/Napster" ,\
|
||||
"Productivity/Networking/News/Clients" ,\
|
||||
"Productivity/Networking/News/Servers" ,\
|
||||
"Productivity/Networking/News/Utilities" ,\
|
||||
"Productivity/Networking/NFS" ,\
|
||||
"Productivity/Networking/NIS" ,\
|
||||
"Productivity/Networking/Novell" ,\
|
||||
"Productivity/Networking/Other" ,\
|
||||
"Productivity/Networking/PPP" ,\
|
||||
"Productivity/Networking/Radius/Clients" ,\
|
||||
"Productivity/Networking/Radius/Servers" ,\
|
||||
"Productivity/Networking/Routing" ,\
|
||||
"Productivity/Networking/SSH" ,\
|
||||
"Productivity/Networking/Samba" ,\
|
||||
"Productivity/Networking/Security" ,\
|
||||
"Productivity/Networking/SSH" ,\
|
||||
"Productivity/Networking/System" ,\
|
||||
"Productivity/Networking/Talk/Clients" ,\
|
||||
"Productivity/Networking/Talk/Servers" ,\
|
||||
@ -175,8 +180,8 @@ setOption("ValidGroups", (
|
||||
"Productivity/Publishing/HTML/Tools" ,\
|
||||
"Productivity/Publishing/Other" ,\
|
||||
"Productivity/Publishing/PDF" ,\
|
||||
"Productivity/Publishing/Presentation" ,\
|
||||
"Productivity/Publishing/PS" ,\
|
||||
"Productivity/Publishing/Presentation" ,\
|
||||
"Productivity/Publishing/SGML" ,\
|
||||
"Productivity/Publishing/TeX/Base" ,\
|
||||
"Productivity/Publishing/TeX/Fonts" ,\
|
||||
@ -197,10 +202,10 @@ setOption("ValidGroups", (
|
||||
"Productivity/Telephony/H323/Clients" ,\
|
||||
"Productivity/Telephony/H323/Servers" ,\
|
||||
"Productivity/Telephony/H323/Utilities" ,\
|
||||
"Productivity/Telephony/Servers" ,\
|
||||
"Productivity/Telephony/SIP/Clients" ,\
|
||||
"Productivity/Telephony/SIP/Servers" ,\
|
||||
"Productivity/Telephony/SIP/Utilities" ,\
|
||||
"Productivity/Telephony/Servers" ,\
|
||||
"Productivity/Telephony/Utilities" ,\
|
||||
"Productivity/Text/Convertors" ,\
|
||||
"Productivity/Text/Editors" ,\
|
||||
|
@ -1,3 +1,30 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 26 11:09:53 CEST 2010 - dmueller@suse.de
|
||||
|
||||
- check for missing xinetd.d (bnc#436326)
|
||||
- check for files in /var/run (fate#303793)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 22 12:02:26 CEST 2010 - dmueller@suse.de
|
||||
|
||||
- check for live update problems (bnc#477649)
|
||||
- rediff and enable the shared lib dependency check fix
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 21 12:47:00 UTC 2010 - aj@suse.de
|
||||
|
||||
- Add some missing rpm groups and sort list.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 19 11:26:37 CEST 2010 - dmueller@suse.de
|
||||
|
||||
- tighten the interpreter check (bnc#574650)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 16 14:36:45 CEST 2010 - dmueller@suse.de
|
||||
|
||||
- suppress warnings about cron.d symlinks (bnc#591431)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 6 18:31:35 CEST 2010 - dmueller@suse.de
|
||||
|
||||
|
14
rpmlint.spec
14
rpmlint.spec
@ -23,7 +23,7 @@ Name: rpmlint
|
||||
BuildRequires: rpm-python
|
||||
Summary: Rpm correctness checker
|
||||
Version: 0.95
|
||||
Release: 3
|
||||
Release: 4
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: config
|
||||
Source1001: config.in
|
||||
@ -62,9 +62,11 @@ Patch3: suse-url-check.diff
|
||||
Patch4: invalid-filerequires.diff
|
||||
Patch5: suse-bzip-bigger-than-100k.diff
|
||||
Patch6: suse-filesystem.diff
|
||||
Patch7: suse-pkg-config-check.diff
|
||||
Patch8: suse-debuginfo.diff
|
||||
Patch9: no-doc-for-lib.diff
|
||||
Patch10: add-scoring-support.diff
|
||||
Patch11: suse-file-var-run.diff
|
||||
Patch12: usr-arch.diff
|
||||
Patch13: script-interpreter-only-for-exec-scripts.diff
|
||||
Patch14: sourced-dirs.diff
|
||||
@ -89,7 +91,7 @@ Patch35: fix-versioned-prereq.diff
|
||||
Patch37: buildroot-in-scripts.diff
|
||||
Patch39: libtool-wrapper-check.diff
|
||||
Patch41: perl-versioned-rpath-deps.diff
|
||||
Patch42: check-cron-dependency.diff
|
||||
Patch42: suse-check-optional-dependencies.diff
|
||||
Patch46: locale-support.diff
|
||||
# not is also in CheckFilelist.py
|
||||
Patch47: noarch-lib64.diff
|
||||
@ -111,6 +113,7 @@ Patch71: suse-binary-info-compile-opts.diff
|
||||
Patch72: version-control-internal-file.diff
|
||||
Patch73: avoid-mismatched-libregex.diff
|
||||
Patch74: filename-non-utf8-exception.diff
|
||||
Patch75: stricter-interpreter-check.diff
|
||||
%py_requires
|
||||
|
||||
%description
|
||||
@ -133,9 +136,11 @@ Authors:
|
||||
%patch4
|
||||
%patch5
|
||||
%patch6
|
||||
%patch7
|
||||
%patch8
|
||||
%patch9
|
||||
#%patch10
|
||||
%patch11
|
||||
%patch12
|
||||
%patch13
|
||||
%patch14
|
||||
@ -160,7 +165,7 @@ Authors:
|
||||
%patch37
|
||||
#%patch39
|
||||
#%patch41
|
||||
#%patch42
|
||||
%patch42
|
||||
#%patch46
|
||||
#%patch47
|
||||
#%patch49
|
||||
@ -173,7 +178,7 @@ Authors:
|
||||
#%patch60
|
||||
%patch62
|
||||
#%patch63
|
||||
#%patch65
|
||||
%patch65
|
||||
#%patch67
|
||||
#%patch68
|
||||
#%patch69
|
||||
@ -181,6 +186,7 @@ Authors:
|
||||
%patch72
|
||||
%patch73
|
||||
%patch74
|
||||
%patch75
|
||||
cp -p %{SOURCE1} .
|
||||
cp -p %{SOURCE2} .
|
||||
cp -p %{SOURCE3} .
|
||||
|
11
stricter-interpreter-check.diff
Normal file
11
stricter-interpreter-check.diff
Normal file
@ -0,0 +1,11 @@
|
||||
--- FilesCheck.py
|
||||
+++ FilesCheck.py
|
||||
@@ -826,7 +826,7 @@
|
||||
f.endswith('.la')):
|
||||
printError(pkg, 'script-without-shebang', f)
|
||||
|
||||
- if mode & 0111 == 0 and not is_doc:
|
||||
+ if mode & 0111 == 0 and not is_doc and interpreter.startswith("/"):
|
||||
printError(pkg, 'non-executable-script', f,
|
||||
oct(perm), interpreter)
|
||||
if line.endswith('\r\n') or line.endswith('\r'):
|
@ -1,21 +1,25 @@
|
||||
--- FilesCheck.py
|
||||
+++ FilesCheck.py
|
||||
@@ -832,6 +832,12 @@
|
||||
logrotate_file=res or logrotate_file
|
||||
if res and res.group(1) != pkg.name:
|
||||
printError(pkg, 'incoherent-logrotate-file', f)
|
||||
@@ -428,6 +428,16 @@
|
||||
if res.group(1) != pkg.name:
|
||||
printError(pkg, 'incoherent-logrotate-file', f)
|
||||
|
||||
+ deps=[x[0] for x in pkg.requires()+pkg.recommends()+pkg.suggests()]
|
||||
+ if res and not ('logrotate' in deps) and pkg.name != "logrotate":
|
||||
+ printError(pkg, 'missing-dependency-to-logrotate', "for logrotate script", f)
|
||||
+ if f.startswith('/etc/cron.') \
|
||||
+ and not ('cron' in deps) and pkg.name != "cron":
|
||||
+ printError(pkg, 'missing-dependency-to-cron', "for cron script", f)
|
||||
link=enreg[3]
|
||||
+ if f.startswith('/etc/xinet.d/') \
|
||||
+ and not ('xinetd' in deps) and pkg.name != "xinetd":
|
||||
+ printError(pkg, 'missing-dependency-to-xinetd', "for xinet.d script", f)
|
||||
+
|
||||
if link != '':
|
||||
ext=compr_regex.search(link)
|
||||
@@ -1464,6 +1470,18 @@
|
||||
if there's no way to produce useful debuginfo out of it, disable creation of
|
||||
the debuginfo package.''',
|
||||
ext = compr_regex.search(link)
|
||||
if ext:
|
||||
@@ -1186,6 +1196,24 @@
|
||||
extraction not working as expected. Verify that the binaries are not
|
||||
unexpectedly stripped and that the intended compiler flags are used.''',
|
||||
|
||||
+'missing-dependency-to-cron',
|
||||
+'''This package installs a file in /etc/cron.*/ but
|
||||
@ -28,6 +32,12 @@
|
||||
+doesn't require logrotate to be installed. Because logrotate is not part of the essential packages,
|
||||
+your package should explicitely depend on logrotate to make sure that your logrotate
|
||||
+job is executed. If it is an optional feature of your package, recommend or suggest logrotate.''',
|
||||
+
|
||||
+'missing-dependency-to-xinetd',
|
||||
+'''This package installs a file in /etc/xinetd.d/ but
|
||||
+doesn't require xinetd to be installed. Because xinetd is not part of the essential packages,
|
||||
+your package should explicitely depend on logrotate to make sure that your xinetd
|
||||
+job is executed. If it is an optional feature of your package, recommend or suggest xinetd.''',
|
||||
+
|
||||
'read-error',
|
||||
'''This file could not be read. A reason for this could be that the info about
|
24
suse-file-var-run.diff
Normal file
24
suse-file-var-run.diff
Normal file
@ -0,0 +1,24 @@
|
||||
--- FilesCheck.py
|
||||
+++ FilesCheck.py
|
||||
@@ -402,6 +402,8 @@
|
||||
printError(pkg, 'dir-or-file-in-usr-local', f)
|
||||
elif f.startswith('/var/local/'):
|
||||
printError(pkg, 'dir-or-file-in-var-local', f)
|
||||
+ elif f.startswith('/var/run/') and f not in ghost_files:
|
||||
+ printError(pkg, 'dir-or-file-in-var-run', f)
|
||||
elif sub_bin_regex.search(f):
|
||||
printError(pkg, 'subdir-in-bin', f)
|
||||
elif f.startswith('/home/'):
|
||||
@@ -945,6 +947,12 @@
|
||||
'''A file in the package is located in /var/local. It's not permitted
|
||||
for packages to install files in this directory.''',
|
||||
|
||||
+'dir-or-file-in-var-run',
|
||||
+'''A file or directory in the package is located in /var/run. It's not
|
||||
+permitted for packages to install files in this directory as it might
|
||||
+be created as tmpfs during boot. Modify your package to create the
|
||||
+necessary files during runtime.''',
|
||||
+
|
||||
'subdir-in-bin',
|
||||
'''The package contains a subdirectory in /usr/bin. It's not permitted to
|
||||
create a subdir there. Create it in /usr/lib/ instead.''',
|
44
suse-pkg-config-check.diff
Normal file
44
suse-pkg-config-check.diff
Normal file
@ -0,0 +1,44 @@
|
||||
--- TagsCheck.py
|
||||
+++ TagsCheck.py
|
||||
@@ -603,10 +603,12 @@
|
||||
base = is_devel.group(1)
|
||||
dep = None
|
||||
has_so = False
|
||||
+ has_pc = False
|
||||
for fname in pkg.files():
|
||||
if fname.endswith('.so'):
|
||||
has_so = True
|
||||
- break
|
||||
+ if fname.endswith('.pc'):
|
||||
+ has_pc = True
|
||||
if has_so:
|
||||
base_or_libs = base + '/' + base + '-libs/lib' + base
|
||||
# try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)")
|
||||
@@ -643,6 +645,15 @@
|
||||
if prov not in (x[0] for x in pkg.provides()):
|
||||
printWarning(pkg, 'no-provides', prov)
|
||||
|
||||
+ if has_pc:
|
||||
+ found_pkg_config_dep = False
|
||||
+ for p in (x[0] for x in pkg.provides()):
|
||||
+ if (p.startswith("pkgconfig(")):
|
||||
+ found_pkg_config_dep = True
|
||||
+ break
|
||||
+ if not found_pkg_config_dep:
|
||||
+ printWarning(pkg, 'no-pkg-config-provides')
|
||||
+
|
||||
# List of words to ignore in spell check
|
||||
ignored_words = [x.split('/')[-1] for x in pkg.files()]
|
||||
|
||||
@@ -1049,6 +1060,11 @@
|
||||
'no-url-tag',
|
||||
'''The URL tag is missing.''',
|
||||
|
||||
+'no-pkg-config-provides',
|
||||
+'''The package installes a .pc file but does not provide pkgconfig(..) provides.
|
||||
+The most likely reason for that is that it was built without BuildRequires: pkg-config.
|
||||
+Please double check your build dependencies.''',
|
||||
+
|
||||
'name-repeated-in-summary',
|
||||
'''The name of the package is repeated in its summary. This is often redundant
|
||||
information and looks silly in various programs' output. Make the summary
|
@ -1,14 +1,15 @@
|
||||
--- TagsCheck.py
|
||||
+++ TagsCheck.py
|
||||
@@ -524,9 +524,9 @@ class TagsCheck(AbstractCheck.AbstractCheck):
|
||||
has_so=1
|
||||
break
|
||||
@@ -610,10 +610,10 @@
|
||||
if fname.endswith('.pc'):
|
||||
has_pc = True
|
||||
if has_so:
|
||||
- base_or_libs = base + '/' + base + '-libs/lib' + base
|
||||
+ 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)")
|
||||
base_or_libs_re = re.compile(
|
||||
- '^(lib)?%s(-libs)?(\(\w+-\d+\))?$' % re.escape(base))
|
||||
+ '^(lib)?%s(-libs)?[\d_]*(\(\w+-\d+\))?$' % re.escape(base))
|
||||
for d in deps:
|
||||
- if d[0] == base or d[0] == base + '-libs' or d[0] == 'lib' + base:
|
||||
+ if d[0] == base or d[0] == base + '-libs' or d[0] == 'lib' + base or d[0].startswith(base):
|
||||
dep=d
|
||||
break
|
||||
if not dep:
|
||||
if base_or_libs_re.match(d[0]):
|
||||
dep = d
|
||||
|
Loading…
Reference in New Issue
Block a user