SHA256
1
0
forked from pool/rpmlint
OBS User unknown 2009-01-12 11:17:10 +00:00 committed by Git OBS Bridge
parent 0eed81f49d
commit 53597c7cde
4 changed files with 66 additions and 20 deletions

View File

@ -27,6 +27,13 @@ def isdebuginfo(pkg):
or pkg.name.endswith('-debug'):
return True
def notsymlink(pkg, f):
files = pkg.files()
enreg = files[f]
mode = enreg[0]
type = (mode>>12)&017
return type != 012
_checks = [
{
'good': [
@ -47,16 +54,16 @@ _checks = [
'bad': [
'/usr/share/info/dir',
'*~',
'*/CV',
'*/CVS/',
'*/.cvsignor',
'*/CVS',
'*/CVS/*',
'*/.cvsignore',
'*/.svn',
'*/RC',
'*/RCS/',
'*/RCS',
'*/RCS/*',
'*,v',
'*.ba',
'*/.xvpic',
'*.ori',
'*.bak',
'*/.xvpics',
'*.orig',
'*.orig.gz',
'/usr/share/*/.libs*',
'/usr/share/*/.deps*',
@ -79,14 +86,27 @@ _checks = [
'error': 'suse-filelist-forbidden-devel-in-lib',
'details': 'please move la files, static libs and .so symlinks out of /',
'bad': [
"/lib/*.so",
"/lib/*.la",
"/lib/*.a",
"/lib64/*.la",
"/lib64/*.a",
"/lib64/*.so",
]
},
{
'error': 'suse-filelist-forbidden-devel-in-lib',
'details': 'please move la files, static libs and .so symlinks out of /',
'good': [
# exception for pam
"/lib/security/*.so",
"/lib64/security/*.so",
],
'bad': [
"/lib/*.so",
"/lib64/*.so",
],
# some libs without proper soname are packaged directly
'ignorefileif': notsymlink,
},
{
'error': 'suse-filelist-forbidden-fhs22',
'msg': '%(file)s is not allowed in FHS 2.2',
@ -147,7 +167,7 @@ _checks = [
'/opt/kde3/lib64/*',
'/usr/lib/pkgconfig/*',
],
'ignoreif': notnoarch,
'ignorepkgif': notnoarch,
},
{
'error': 'suse-filelist-forbidden-debuginfo',
@ -155,7 +175,7 @@ _checks = [
'bad': [
'/usr/lib/debug/*',
],
'ignoreif': isdebuginfo,
'ignorepkgif': isdebuginfo,
},
{
'error': 'suse-filelist-forbidden-locale',
@ -241,6 +261,18 @@ _checks = [
'/sbin/conf.d/*',
],
},
{
'error': 'suse-filelist-forbidden-opt',
'details': """/opt may not be used by a distribution. It is reserved for 3rd party packagers""",
'good': [
# KDE3 legacy exception
'/opt/kde3',
'/opt/kde3/*',
],
'bad': [
'/opt/*',
],
},
{
'error': 'suse-filelist-forbidden-fhs22',
'good': [
@ -263,6 +295,8 @@ _checks = [
'/media/*',
'/mnt',
'/opt',
# handled in separate check
'/opt/*',
'/proc',
'/root',
'/root/.exrc',
@ -412,8 +446,8 @@ class FilelistCheck(AbstractCheck.AbstractCheck):
for check in _checks:
if 'ignoreif' in check:
if check['ignoreif'](pkg):
if 'ignorepkgif' in check:
if check['ignorepkgif'](pkg):
continue
if 'msg' in check:
@ -430,16 +464,19 @@ class FilelistCheck(AbstractCheck.AbstractCheck):
ok = False
if 'good' in check:
for g in check['good']:
if (not isinstance(g, str)) and g.match(f) or g == f:
if (not isinstance(g, str) and g.match(f)) or g == f:
ok = True
break
if ok:
continue
for b in check['bad']:
if (not isinstance(b, str)) and b.match(f) or b == f:
msg = msg % { 'file':f }
printError(pkg, error, msg)
if 'ignorefileif' in check:
if check['ignorefileif'](pkg, f):
continue
if (not isinstance(b, str) and b.match(f)) or b == f:
m = msg % { 'file':f }
printError(pkg, error, m)
check=FilelistCheck()

View File

@ -103,7 +103,7 @@ class PolkitCheck(AbstractCheck.AbstractCheck):
if iserr:
printError(pkg, 'polkit-unauthorized-privilege', action)
else:
printWarning(pkg, 'polkit-unauthorized-privilege', action)
printInfo(pkg, 'polkit-unauthorized-privilege', action)
if foundno or not anyseen:
printWarning(pkg, 'polkit-cant-acquire-privilege', action)

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 12 10:48:19 CET 2009 - lnussel@suse.de
- CheckFilelist: add exceptions for kde and pam
- CheckPolkitPrivs: use info instead of warning to avoid badness assignment
-------------------------------------------------------------------
Thu Jan 8 11:05:50 CET 2009 - lnussel@suse.de

View File

@ -22,7 +22,7 @@ Name: rpmlint
BuildRequires: rpm-python
Summary: Rpm correctness checker
Version: 0.84
Release: 7
Release: 9
Source0: %{name}-%{version}.tar.bz2
Source1: config
Source1001: config.in
@ -220,6 +220,9 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/man/man1/rpmlint.1.gz
%changelog
* Mon Jan 12 2009 lnussel@suse.de
- CheckFilelist: add exceptions for kde and pam
- CheckPolkitPrivs: use info instead of warning to avoid badness assignment
* Thu Jan 08 2009 lnussel@suse.de
- prefix dbus check with suse-
- add filelist check