forked from pool/rpmlint
This commit is contained in:
parent
b86bedd5a6
commit
60d7135645
@ -85,6 +85,17 @@ class BrandingPolicyCheck(AbstractCheck.AbstractCheck):
|
||||
branding_provide=p
|
||||
break
|
||||
|
||||
# check for Conflicts: otherproviders(kde4-kdm-branding)
|
||||
conflict_prop = "otherproviders(%s)" % (generic_branding)
|
||||
have_conflict_prop = False
|
||||
for c in pkg_conflicts:
|
||||
if c[0] == conflict_prop:
|
||||
have_conflict_prop = True
|
||||
break
|
||||
|
||||
if not have_conflict_prop:
|
||||
printError(pkg,'suse-branding-missing-conflicts', conflict_prop)
|
||||
|
||||
if not branding_provide:
|
||||
printError(pkg,'suse-branding-no-branding-provide')
|
||||
else:
|
||||
@ -108,5 +119,9 @@ if Config.info:
|
||||
'suse-branding-supplement-missing',
|
||||
"""branding packages should provide a supplemnent in the form
|
||||
Supplements: packageand(basepackage:branding-<flavour>)
|
||||
"""
|
||||
""",
|
||||
'suse-branding-missing-conflicts',
|
||||
"""Any branding flavor package that provides the generic branding
|
||||
must also conflict with all other branding packages via a special
|
||||
otherproviders()""",
|
||||
)
|
||||
|
@ -38,6 +38,21 @@ _kde4_pimlibs=(
|
||||
"libsyndication.so.4"
|
||||
)
|
||||
|
||||
_kde4_libkdepim4 = (
|
||||
"libkdepim.so.4",
|
||||
"libkontactinterfaces.so.4",
|
||||
"libkleopatraclientcore.so.0.2.0",
|
||||
"libkleopatraclientgui.so.0.2.0",
|
||||
)
|
||||
|
||||
_kde4_libakonadi4 = (
|
||||
"libakonadi-kde.so.4",
|
||||
"libakonadi-kabc.so.4",
|
||||
"libakonadi-kcal.so.4",
|
||||
"libakonadi-kmime.so.4",
|
||||
"libakonadiprotocolinternals.so.1",
|
||||
)
|
||||
|
||||
class KDE4Check(AbstractCheck.AbstractCheck):
|
||||
def __init__(self):
|
||||
AbstractCheck.AbstractCheck.__init__(self, "KDE4Check")
|
||||
@ -62,11 +77,34 @@ class KDE4Check(AbstractCheck.AbstractCheck):
|
||||
kdepimlibs4_dep=True
|
||||
break
|
||||
|
||||
libkdepim4_dep=False
|
||||
for r in pkg_requires:
|
||||
if r in _kde4_libkdepim4:
|
||||
libkdepim4_dep =True
|
||||
break
|
||||
|
||||
libakonadi4_dep=False
|
||||
for r in pkg_requires:
|
||||
if r in _kde4_libakonadi4:
|
||||
libakonadi4_dep =True
|
||||
break
|
||||
|
||||
if not pkg.name.startswith("lib"):
|
||||
if "libkdepimlibs4" in pkg_requires and not kdepimlibs4_dep:
|
||||
printError(pkg,"suse-kde4-excessive-pimlibs-dependency")
|
||||
if not "libkdepimlibs4" in pkg_requires and kdepimlibs4_dep:
|
||||
printError(pkg,"suse-kde4-missing-pimlibs-dependency")
|
||||
if "kdepimlibs4" in pkg_requires and not kdepimlibs4_dep:
|
||||
printError(pkg,"suse-kde4-excessive-dependency", "%kde4_pimlibs_requires")
|
||||
if not "kdepimlibs4" in pkg_requires and kdepimlibs4_dep:
|
||||
printError(pkg,"suse-kde4-missing-dependency", "%kde4_pimlibs_requires")
|
||||
|
||||
if "libkdepim4" in pkg_requires and not libkdepim4_dep:
|
||||
printError(pkg,"suse-kde4-excessive-dependency", "libkdepim4")
|
||||
if not "libkdepim4" in pkg_requires and libkdepim4_dep:
|
||||
printError(pkg,"suse-kde4-missing-dependency", "libkdepim4")
|
||||
|
||||
if "akonadi-runtime" in pkg_requires and not libakonadi4_dep:
|
||||
printError(pkg,"suse-kde4-excessive-dependency", "%kde4_akonadi_requires")
|
||||
if not "akonadi-runtime" in pkg_requires and libakonadi4_dep:
|
||||
printError(pkg,"suse-kde4-missing-dependency", "%kde4_akonadi_requires")
|
||||
|
||||
|
||||
check=KDE4Check()
|
||||
|
||||
|
@ -21,6 +21,16 @@ class PkgConfigCheck(AbstractCheck.AbstractFilesCheck):
|
||||
#self.suspicious_dir=re.compile('(?:/usr/src/\w+/BUILD|/var/tmp|/tmp|/home|\@\w{1,50}\@)')
|
||||
self.suspicious_dir=re.compile('(?:/usr/src/\w+/BUILD|/var/tmp|/tmp|/home)')
|
||||
|
||||
def check(self, pkg):
|
||||
# check for references to /lib when in lib64 mode
|
||||
if pkg.arch in ('x86_64', 'ppc64', 's390x'):
|
||||
self.wronglib_dir=re.compile('-L/usr/lib\\b')
|
||||
else:
|
||||
self.wronglib_dir=re.compile('-L/usr/lib64\\b')
|
||||
|
||||
AbstractCheck.AbstractFilesCheck.check(self, pkg)
|
||||
|
||||
|
||||
def check_file(self, pkg, filename):
|
||||
if pkg.isSource():
|
||||
return
|
||||
@ -28,6 +38,11 @@ class PkgConfigCheck(AbstractCheck.AbstractFilesCheck):
|
||||
if pkg.grep(self.suspicious_dir, filename):
|
||||
printError(pkg, "invalid-pkgconfig-file", filename)
|
||||
|
||||
pc_file=file(pkg.dirName() + "/" + filename, "r")
|
||||
for l in pc_file:
|
||||
if l.startswith('Libs:') and self.wronglib_dir.search(l):
|
||||
printError(pkg, 'pkgconfig-invalid-libs-dir', filename, l)
|
||||
|
||||
check=PkgConfigCheck()
|
||||
|
||||
if Config.info:
|
||||
@ -39,5 +54,9 @@ if Config.info:
|
||||
- it references invalid paths (e.g. /home or /tmp)
|
||||
|
||||
Please double-check and report false positives.
|
||||
'''
|
||||
''',
|
||||
'pkgconfig-invalid-libs-dir',
|
||||
''' Your .pc file contains -L/usr/lib or -L/lib and is built for a lib64 target,
|
||||
or contains references to -L/usr/lib64 or -L/lib64 and is built for a lib target.
|
||||
Please remove the wrong library paths from the pc file.'''
|
||||
)
|
||||
|
@ -29,16 +29,20 @@ class DesktopCheck(AbstractCheck.AbstractFilesCheck):
|
||||
printWarning(pkg, "read-error", e)
|
||||
return 0
|
||||
|
||||
found_desktop_group=False
|
||||
for line in f:
|
||||
if line.startswith('X-SuSE-translate='):
|
||||
return
|
||||
printWarning(pkg, "untranslated-desktop-file", filename)
|
||||
if line.startswith('[Desktop Entry]'):
|
||||
found_desktop_group=True
|
||||
if found_desktop_group:
|
||||
printWarning(pkg, "untranslated-desktop-file", filename)
|
||||
|
||||
check=DesktopCheck()
|
||||
|
||||
if Config.info:
|
||||
addDetails(
|
||||
'untranslated-desktop-file',
|
||||
"""Your desktop file hasn't been handled by suse_update_desktop.sh.
|
||||
"""Your desktop file hasn't been handled by %suse_update_desktop_file
|
||||
Please use it to make the desktop file translate-able by Novell translations."""
|
||||
)
|
||||
|
@ -5,7 +5,7 @@
|
||||
includefile_regex=re.compile('\.(c|h|a|cmi)$')
|
||||
buildconfigfile_regex=re.compile('(\.pc|/bin/.+-config)$')
|
||||
+docdir_examples_regex=re.compile('^/usr/(?:share/doc/packages|lib(?:64))/[^/]+/(?:example|demo|script|contrib)')
|
||||
sofile_regex=re.compile('/lib(64)?(?:/.+)?/lib[^/]+\.so$')
|
||||
sofile_regex=re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$')
|
||||
devel_regex=re.compile('(.*)-(debug(info)?|devel|source|static)$')
|
||||
debuginfo_package_regex=re.compile('-debug(info)?$')
|
||||
@@ -990,7 +991,7 @@
|
||||
|
@ -1,14 +0,0 @@
|
||||
--- SpecCheck.py
|
||||
+++ SpecCheck.py
|
||||
@@ -342,9 +342,9 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||
(ifarch_regex.search(line) or if_regex.search(line) or
|
||||
endif_regex.search(line)):
|
||||
if defattr_regex.search(line):
|
||||
- files_has_defattr = 1;
|
||||
+ files_has_defattr = 1;
|
||||
elif not (files_has_defattr or attr_regex.search(line)):
|
||||
- printError(pkg, 'files-attr-not-set')
|
||||
+ printError(pkg, 'files-attr-not-set')
|
||||
|
||||
# TODO: check scriptlets for these too
|
||||
if current_section == 'files' and noarch:
|
@ -1,11 +0,0 @@
|
||||
--- BinariesCheck.py
|
||||
+++ BinariesCheck.py
|
||||
@@ -341,7 +341,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
if bin_info.stack:
|
||||
if bin_info.exec_stack:
|
||||
printWarning(pkg, 'executable-stack', i[0])
|
||||
- else:
|
||||
+ elif pkg.arch != 'ia64' and pkg.arch != 'ppc64':
|
||||
printError(pkg, 'missing-PT_GNU_STACK-section', i[0])
|
||||
|
||||
else:
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a4bb8e93c14e86c7d0d2774bcb9147f5de54e117dd573e989f45a927feffd29d
|
||||
size 81991
|
3
rpmlint-0.84.tar.bz2
Normal file
3
rpmlint-0.84.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:549feb0da65719327afef7d30481111624379faadf0493d63151a9f517489869
|
||||
size 82164
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 7 15:53:11 CET 2008 - dmueller@suse.de
|
||||
|
||||
- add check for otherproviders() in branding packages
|
||||
- correct kde4 related dependency checkers to not give false advises
|
||||
- check for wrong-arch references in pkgconfig files (graphviz)
|
||||
- lower false positives of untranslated-desktop files check
|
||||
- support for checking .comment.SUSE.OPTs. real check has been
|
||||
left out for now
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 4 14:45:40 CET 2008 - lnussel@suse.de
|
||||
|
||||
@ -8,6 +18,13 @@ Tue Oct 28 10:00:09 CET 2008 - lnussel@suse.de
|
||||
|
||||
- add check for /etc/permissions violations
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 3 19:50:23 CEST 2008 - dmueller@suse.de
|
||||
|
||||
- update to 0.84:
|
||||
* remove upstreamed patches
|
||||
* no significant changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 3 13:58:22 CEST 2008 - dmueller@suse.de
|
||||
|
||||
|
43
rpmlint.spec
43
rpmlint.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package rpmlint (Version 0.83)
|
||||
# spec file for package rpmlint (Version 0.84)
|
||||
#
|
||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -21,8 +21,8 @@
|
||||
Name: rpmlint
|
||||
BuildRequires: rpm-python
|
||||
Summary: Rpm correctness checker
|
||||
Version: 0.83
|
||||
Release: 43
|
||||
Version: 0.84
|
||||
Release: 2
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: config
|
||||
Source1001: config.in
|
||||
@ -62,7 +62,6 @@ Patch11: suse-spec-bzip2.diff
|
||||
Patch12: usr-arch.diff
|
||||
Patch13: script-interpreter-only-for-exec-scripts.diff
|
||||
Patch14: sourced-dirs.diff
|
||||
Patch15: subdir-dangling-symlink.diff
|
||||
Patch16: dependency-parsing.diff
|
||||
Patch17: docdata-examples.diff
|
||||
Patch18: suse-hide-unstripped-outside-build.diff
|
||||
@ -95,16 +94,15 @@ Patch54: locale-update.diff
|
||||
Patch57: suse-mono-deps-checks.diff
|
||||
Patch58: add-weak-dependencies.diff
|
||||
Patch60: selfconflicts-provide.diff
|
||||
Patch61: fix-tabs-indenting.diff
|
||||
Patch62: no-badness-return.diff
|
||||
Patch63: suse-factory-config.diff
|
||||
Patch64: pt-gnu-stack.diff
|
||||
Patch65: suse-shlib-devel-dependency.diff
|
||||
Patch66: suse-no-python-base.diff
|
||||
Patch67: suse-required-lsb-tags.diff
|
||||
Patch68: more-verbose-lsb-check.diff
|
||||
Patch69: useless-requires-doc.diff
|
||||
Patch70: subprocess-support.diff
|
||||
Patch71: suse-binary-info-compile-opts.diff
|
||||
%py_requires
|
||||
|
||||
%description
|
||||
@ -135,7 +133,6 @@ Authors:
|
||||
%patch12
|
||||
%patch13
|
||||
%patch14
|
||||
%patch15
|
||||
%patch16
|
||||
%patch17
|
||||
%patch18
|
||||
@ -168,16 +165,15 @@ Authors:
|
||||
%patch57
|
||||
%patch58
|
||||
%patch60
|
||||
%patch61
|
||||
%patch62
|
||||
%patch63
|
||||
%patch64
|
||||
%patch65
|
||||
%patch66
|
||||
%patch67
|
||||
%patch68
|
||||
%patch69
|
||||
%patch70
|
||||
%patch71
|
||||
cp -p %{SOURCE1} .
|
||||
cp -p %{SOURCE2} .
|
||||
cp -p %{SOURCE3} .
|
||||
@ -218,13 +214,24 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/man/man1/rpmlint.1.gz
|
||||
|
||||
%changelog
|
||||
* Fri Nov 07 2008 dmueller@suse.de
|
||||
- add check for otherproviders() in branding packages
|
||||
- correct kde4 related dependency checkers to not give false advises
|
||||
- check for wrong-arch references in pkgconfig files (graphviz)
|
||||
- lower false positives of untranslated-desktop files check
|
||||
- support for checking .comment.SUSE.OPTs. real check has been
|
||||
left out for now
|
||||
* Tue Nov 04 2008 lnussel@suse.de
|
||||
- generate a different error for directories with setuid/setgid bit
|
||||
* Tue Oct 28 2008 lnussel@suse.de
|
||||
- add check for /etc/permissions violations
|
||||
* Fri Oct 03 2008 dmueller@suse.de
|
||||
- update to 0.84:
|
||||
* remove upstreamed patches
|
||||
* no significant changes
|
||||
* Wed Sep 03 2008 dmueller@suse.de
|
||||
- add description for useless-explicit-requires (bnc#405887)
|
||||
* Thu Aug 21 2008 dmueller@suse.de
|
||||
* Wed Aug 20 2008 dmueller@suse.de
|
||||
- rediff patch
|
||||
* Mon Aug 18 2008 schwab@suse.de
|
||||
- Fix name of completions file.
|
||||
@ -247,7 +254,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- also read /etc/rpmlint/factory.config
|
||||
* Fri Jun 27 2008 dmueller@suse.de
|
||||
- fix typo in suse-version check
|
||||
* Mon Jun 23 2008 dmueller@suse.de
|
||||
* Sun Jun 22 2008 dmueller@suse.de
|
||||
- update to 0.83:
|
||||
* removed upstreamed patches
|
||||
* a couple of new checks, bugfixes
|
||||
@ -388,7 +395,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- fix hardlink check for /bin
|
||||
* Sat Sep 01 2007 schwab@suse.de
|
||||
- Fix last change.
|
||||
* Sat Sep 01 2007 dmueller@suse.de
|
||||
* Fri Aug 31 2007 dmueller@suse.de
|
||||
- fix off-by-one in hardlink check
|
||||
* Fri Aug 31 2007 dmueller@suse.de
|
||||
- fix exception in DuplicatesCheck
|
||||
@ -435,7 +442,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- its also a devel package if it provides a -devel subpackage (#289735)
|
||||
* Wed Jul 04 2007 dmueller@suse.de
|
||||
- suppress %%config check for now (#286231)
|
||||
* Wed Jun 27 2007 dmueller@suse.de
|
||||
* Tue Jun 26 2007 dmueller@suse.de
|
||||
- fix typo in devel-rpmgroup check
|
||||
* Mon Jun 25 2007 dmueller@suse.de
|
||||
- another update list of legacy packages
|
||||
@ -500,7 +507,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- add description for missing lsb tags check
|
||||
- fix obsolete-not-provided for yast2-provides
|
||||
- fix devel-file check matching module names (e.g. apache2)
|
||||
* Sat May 26 2007 dmueller@suse.de
|
||||
* Fri May 25 2007 dmueller@suse.de
|
||||
- avoid spurious executable warnings for docdatadir/examples
|
||||
- add LibraryPolicy checker from Richard (warning only)
|
||||
- suppression update
|
||||
@ -533,15 +540,15 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- Suppress devel-file-in-non-devel-package for systemtap (#277338)
|
||||
- Make sure that the package fails if there is any syntax
|
||||
error anywhere
|
||||
* Wed May 23 2007 dmueller@suse.de
|
||||
* Tue May 22 2007 dmueller@suse.de
|
||||
- typo fix
|
||||
* Tue May 22 2007 dmueller@suse.de
|
||||
- update config
|
||||
* Sat May 19 2007 coolo@suse.de
|
||||
- add three more checks
|
||||
* Fri May 18 2007 dmueller@suse.de
|
||||
* Thu May 17 2007 dmueller@suse.de
|
||||
- update Duplicates Check to not crash on ghost files
|
||||
* Wed May 16 2007 dmueller@suse.de
|
||||
* Tue May 15 2007 dmueller@suse.de
|
||||
- suppress bzip2 related warnings
|
||||
- no documentation for lib packages
|
||||
* Tue May 15 2007 coolo@suse.de
|
||||
@ -562,7 +569,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Fri May 04 2007 dmueller@suse.de
|
||||
- remove check for usedforbuild tag. magic happens and
|
||||
it is created automatically
|
||||
* Thu Apr 19 2007 dmueller@suse.de
|
||||
* Wed Apr 18 2007 dmueller@suse.de
|
||||
- add spec checks for obsolete suse hacks
|
||||
* Wed Apr 18 2007 dmueller@suse.de
|
||||
- update to 0.80:
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- FilesCheck.py
|
||||
+++ FilesCheck.py
|
||||
@@ -651,7 +651,7 @@
|
||||
bin_regex=re.compile('^(/usr)?/s?bin/')
|
||||
includefile_regex=re.compile('\.(c|h|a|cmi)$')
|
||||
buildconfigfile_regex=re.compile('(\.pc|/bin/.+-config)$')
|
||||
-sofile_regex=re.compile('/lib(64)?/[^/]+\.so$')
|
||||
+sofile_regex=re.compile('/lib(64)?(?:/.+)?/lib[^/]+\.so$')
|
||||
devel_regex=re.compile('(.*)-(debug(info)?|devel|source|static)$')
|
||||
debuginfo_package_regex=re.compile('-debug(info)?$')
|
||||
lib_regex=re.compile('lib(64)?/lib[^/]*\.so\..*')
|
25
suse-binary-info-compile-opts.diff
Normal file
25
suse-binary-info-compile-opts.diff
Normal file
@ -0,0 +1,25 @@
|
||||
--- BinariesCheck.py
|
||||
+++ BinariesCheck.py
|
||||
@@ -51,10 +51,11 @@ class BinaryInfo:
|
||||
self.exec_stack = 0
|
||||
self.debuginfo=0
|
||||
self.symtab=0
|
||||
+ self.compileOpts=set()
|
||||
|
||||
is_debug=BinaryInfo.debug_file_regex.search(path)
|
||||
|
||||
- cmd = ['env', 'LC_ALL=C', 'readelf', '-W', '-S', '-l', '-d']
|
||||
+ cmd = ['env', 'LC_ALL=C', 'readelf', '-W', '-S', '-l', '-d', '-p', '.comment.SUSE.OPTs']
|
||||
cmd.append(path)
|
||||
res = Pkg.getstatusoutput(cmd)
|
||||
if not res[0]:
|
||||
@@ -100,6 +101,9 @@ class BinaryInfo:
|
||||
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])
|
||||
else:
|
Loading…
Reference in New Issue
Block a user