OBS User unknown 2008-12-06 13:44:13 +00:00 committed by Git OBS Bridge
parent 3415c119ca
commit 84f088287b
4 changed files with 49 additions and 5 deletions

View File

@ -351,6 +351,7 @@ _essential_dependencies = (
"libgcrypt.so.11",
"libgdbm_compat.so.3",
"libgdbm.so.3",
"libgfortran3",
"libgio-2.0.so.0",
"libglib-2.0.so.0",
"libgmodule-2.0.so.0",
@ -496,6 +497,7 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck):
# Search for shared libraries in this package
libs = set()
libs_needed = set()
libs_to_dir = dict()
dirs = set()
reqlibs = set()
pkg_requires = set(map(lambda x: string.split(x[0],'(')[0], pkg.requires()))
@ -508,8 +510,10 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck):
bi = BinaryInfo(pkg, filename, f, 0)
libs_needed = libs_needed.union(bi.needed)
if bi.soname != 0:
lib_dir = string.join(f.split('/')[:-1], '/')
libs.add(bi.soname)
dirs.add(string.join(f.split('/')[:-1], '/'))
libs_to_dir[bi.soname] = lib_dir
dirs.add(lib_dir)
if bi.soname in pkg_requires:
# But not if the library is used by the pkg itself
# This avoids program packages with their own private lib
@ -522,11 +526,35 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck):
std_dirs = dirs.intersection(('/lib', '/lib64', '/usr/lib', '/usr/lib64',
'/opt/kde3/lib'))
non_std_dirs = dirs.difference(std_dirs)
# If this is a program package (all libs it provides are
# required by itself), bail out
if not pkg.name.startswith("lib") and len(libs.difference(reqlibs)) == 0:
return
std_lib_package = False
if pkg.name.startswith("lib") and pkg.name[-1].isdigit():
std_lib_package = True
# ignore libs in a versioned non_std_dir
if std_lib_package:
for lib in libs.copy():
lib_dir = libs_to_dir[lib]
for lib_part in lib_dir.split('/'):
if len(lib_part) == 0:
continue
if lib_part[-1].isdigit() and not lib_part.endswith("lib64"):
libs.remove(lib)
break
# Check for non-versioned libs in a std lib package
if std_lib_package:
for lib in libs.copy():
if not lib[-1].isdigit():
printWarning(pkg, "shlib-unversioned-lib", lib)
libs.remove(lib)
# If this package should be or should be splitted into shlib
# package(s)
if len(libs) > 0 and len(std_dirs) > 0:
@ -606,5 +634,10 @@ a seperate one to reduce the additional dependencies for other users of this lib
'shlib-policy-missing-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."""
sensible name.""",
'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
in parallel to another version of this library package. Consider moving unversioned
parts into a runtime package."""
)

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Dec 3 08:50:33 CET 2008 - dmueller@suse.de
- update suse version check (add 11.1, drop 10.2)
- check library packages more strict (bnc#456053)
- ignore shared objects in a versioned non-std subdir (bnc#435588)
-------------------------------------------------------------------
Thu Nov 20 23:12:56 CET 2008 - dmueller@suse.de

View File

@ -22,7 +22,7 @@ Name: rpmlint
BuildRequires: rpm-python
Summary: Rpm correctness checker
Version: 0.84
Release: 3
Release: 4
Source0: %{name}-%{version}.tar.bz2
Source1: config
Source1001: config.in
@ -214,6 +214,10 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/man/man1/rpmlint.1.gz
%changelog
* Wed Dec 03 2008 dmueller@suse.de
- update suse version check (add 11.1, drop 10.2)
- check library packages more strict (bnc#456053)
- ignore shared objects in a versioned non-std subdir (bnc#435588)
* Thu Nov 20 2008 dmueller@suse.de
- only test for regular files in ChkPkgConfig check
* Fri Nov 07 2008 dmueller@suse.de

View File

@ -14,9 +14,9 @@
- res = prereq_regex.search(line)
+ res = suse_version_regex.search(line)
+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1020:
+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1030:
+ printWarning(pkg, "obsolete-suse-version-check", res.group(1))
+ elif res and int(res.group(1)) > 1100:
+ elif res and int(res.group(1)) > 1110:
+ printError(pkg, "invalid-suse-version-check", res.group(1))
+
+ res = prereq_regex.search(line)