forked from pool/rpmlint
This commit is contained in:
parent
23d901309b
commit
9bca805221
85
BrandingPolicyCheck.py
Normal file
85
BrandingPolicyCheck.py
Normal file
@ -0,0 +1,85 @@
|
||||
# vim:sw=4:et
|
||||
#############################################################################
|
||||
# File : BrandingPolicyCheck.py
|
||||
# Package : rpmlint
|
||||
# Author : Dirk Mueller
|
||||
# Purpose : Verify that branding related things comply
|
||||
#############################################################################
|
||||
|
||||
from Filter import *
|
||||
import AbstractCheck
|
||||
import rpm
|
||||
import re
|
||||
import commands
|
||||
import stat
|
||||
import Config
|
||||
import os
|
||||
import string
|
||||
import Pkg
|
||||
|
||||
from BinariesCheck import BinaryInfo
|
||||
|
||||
class BrandingPolicyCheck(AbstractCheck.AbstractCheck):
|
||||
def __init__(self):
|
||||
self.map = []
|
||||
AbstractCheck.AbstractCheck.__init__(self, "BrandingPolicyCheck")
|
||||
|
||||
def check(self, pkg):
|
||||
if pkg.isSource():
|
||||
return
|
||||
|
||||
pkg_requires = set(map(lambda x: string.split(x[0],'(')[0], pkg.requires()))
|
||||
pkg_conflicts = set(map(lambda x: string.split(x[0],'(')[0], pkg.conflicts()))
|
||||
|
||||
# verify that only generic branding is required by non-branding packages
|
||||
for r in pkg_requires:
|
||||
if (pkg.name.find('-branding-') < 0 and
|
||||
(r.find('-theme-') >= 0 or r.find('-branding-') >= 0)):
|
||||
printError(pkg,'suse-branding-specific-branding-req', r)
|
||||
if r.endswith('branding') or r.endswith('theme'):
|
||||
if (r[2] != rpm.RPMSENSE_EQUAL or not r[1].startswith('1')):
|
||||
printError(pkg,'suse-branding-unversioned-req', r[0])
|
||||
|
||||
# verify that it doesn't conflict with branding
|
||||
for r in pkg_conflicts:
|
||||
if r.find('-theme-') >= 0 or r.find('-branding-') >= 0:
|
||||
printError(pkg,'suse-branding-branding-conflict', r)
|
||||
|
||||
if pkg.name.find('-branding-') < 0:
|
||||
return
|
||||
|
||||
branding_basename=pkg.name.partition('-branding-')[0]
|
||||
branding_style=pkg.name.partition('-branding-')[2]
|
||||
generic_branding = ("%s-branding" % (branding_basename))
|
||||
|
||||
pkg_provides = set(map(lambda x: string.split(x[0],'(')[0], pkg.provides()))
|
||||
|
||||
# check for provide foo-branding
|
||||
branding_provide=None
|
||||
for p in pkg.provides():
|
||||
if p[0] == generic_branding:
|
||||
branding_provide=p
|
||||
break
|
||||
|
||||
if not branding_provide:
|
||||
printError(pkg,'suse-branding-no-branding-provide')
|
||||
else:
|
||||
if (branding_provide[2] != rpm.RPMSENSE_EQUAL or
|
||||
not branding_provide[1].startswith('1')):
|
||||
printError(pkg, 'suse-branding-unversioned-prov', branding_provide)
|
||||
|
||||
for r in pkg.requires():
|
||||
if r[0].find('-theme-') >= 0 or r[0].find('-branding-') >= 0:
|
||||
if (r[2] != rpm.RPMSENSE_EQUAL or not r[1].startswith('1')):
|
||||
printError(pkg, 'suse-branding-unversioned-req', r[0])
|
||||
|
||||
|
||||
check=BrandingPolicyCheck()
|
||||
|
||||
if Config.info:
|
||||
addDetails(
|
||||
'suse-branding-specific-branding-req',
|
||||
"""bla""",
|
||||
'suse-branding-no-branding-provides',
|
||||
"""bla""",
|
||||
)
|
20
config
20
config
@ -24,6 +24,7 @@ addCheck("DuplicatesCheck")
|
||||
addCheck("LibraryPolicyCheck")
|
||||
addCheck("CheckIconSizes")
|
||||
#addCheck("CheckStaticLibraries")
|
||||
addCheck("BrandingPolicyCheck")
|
||||
|
||||
# stuff autobuild takes care about
|
||||
addFilter(".*invalid-version.*")
|
||||
@ -46,16 +47,14 @@ setOption("UseUTF8", 1)
|
||||
#setOption("ReleaseExtension", None)
|
||||
#setOption("ValidGroups", ("Group1", "Group2"))
|
||||
#setOption("KernelModuleRPMsOK", 0)
|
||||
setOption('StandardGroups',
|
||||
('root', 'bin', 'daemon', 'adm', 'lp', 'sync', 'shutdown', 'halt',
|
||||
'mail', 'news', 'uucp', 'man', 'nobody', 'games', 'disk', 'tty',
|
||||
'nogroup', 'video', 'www', 'dialout', 'mysql'))
|
||||
|
||||
setOption('StandardUsers',
|
||||
('root', 'bin', 'daemon', 'adm', 'lp', 'sync',
|
||||
'shutdown', 'halt', 'mail', 'news', 'uucp',
|
||||
'operator', 'man', 'nobody', 'otrs', 'wnn', 'fax', 'beagleindex',
|
||||
'asterisk', 'wwwrun', 'games', 'tomcat', 'squid', 'mysql'))
|
||||
setOption('StandardGroups', ('tty', 'antivir', 'dba', 'aegis', 'disk', 'localham', 'casaauth', 'console', 'lp', 'ldap', 'dovecot', 'otrs', 'tss', 'pulse-rt', 'oinstall', 'postgres', 'kmem', 'nagcmd', 'maildrop', 'pegasus', 'ffums', 'intermezzo', 'shadow', 'daemon', 'xok', 'novell_nogroup', 'snort', 'pulse-access', 'powersave', 'www', 'beagleindex', 'pkcs11', 'pulse', 'ifdrwww', 'video', 'ftp', 'jboss', 'icecream', 'memcached', 'public', 'uuidd', 'ntp', 'ntadmin', 'dosemu', 'news', 'haclient', 'sshd', 'games', 'jonas', 'cwbconv', 'named', 'novlxtier', 'pdns', 'mailman', 'festival', 'utmp', 'floppy', 'nobody', 'lighttpd', 'quagga', 'suse-ncc', 'dialout', 'mail', 'cdrom', 'polkituser', 'haldaemon', 'sapdb', 'geronimo', 'sabayon-admin', 'privoxy', 'avahi', 'mdom', 'bin', 'pound', 'distcc', 'nagios', 'tomcat4', 'at', 'trusted', 'uucp', 'zope', 'wheel', 'users', 'messagebus', 'kvm', 'sys', 'vscan', 'man', 'audio', 'nogroup', 'tomcat', 'postfix', 'bigsister', 'modem', 'radiusd'))
|
||||
setOption('StandardUsers', ('novell_nobody', 'aegis', 'mysql', 'gdm', 'casaauth', 'icecream', 'lp', 'ldap', 'dovecot', 'otrs', 'tss', 'bin', 'fax', 'postgres', 'intermezzo', 'hacluster', 'pegasus', 'ffums', 'radiusd', 'daemon', 'vdr', 'snort', 'amanda', 'bitlbee', 'beagleindex', 'fetchmail', 'pulse', 'mdnsd', 'novlxregd', 'wwwrun', 'gnump3d', 'ftp', 'jboss', 'dvbdaemon', 'irc', 'memcached', 'uuidd', 'ntp', 'jonas', 'news', 'cop', 'sshd', 'novlifdr', 'casaatsd', 'games', 'upsd', 'named', 'pop', 'dhcpd', 'gnats', 'jabber', 'pdns', 'mailman', 'festival', 'cyrus', 'nobody', 'lighttpd', 'quagga', 'mail', 'polkituser', 'haldaemon', 'sapdb', 'geronimo', 'postfix', 'privoxy', 'novlxsrvd', 'avahi', 'mdom', 'root', 'pound', 'squid', 'distcc', 'nagios', 'tomcat4', 'at', 'dpbox', 'partimag', 'uucp', 'zope', 'messagebus', 'wnn', 'asterisk', 'casaatvd', 'vscan', 'man', 'suse-ncc', 'tomcat', 'sabayon-admin', 'bigsister', 'oracle'))
|
||||
|
||||
setOption('DanglingSymlinkExceptions',
|
||||
(['/usr/share/doc/licenses/', 'licenses'],
|
||||
['consolehelper$', 'usermode-consoleonly'],
|
||||
))
|
||||
|
||||
# Output filters
|
||||
addFilter(".*spurious-bracket-in-.*")
|
||||
@ -139,6 +138,7 @@ addFilter("dangling-relative-symlink")
|
||||
addFilter(" lib-package-without-%mklibname")
|
||||
addFilter(" requires-on-release")
|
||||
addFilter(" non-executable-script /etc/profile.d/")
|
||||
addFilter(" non-executable-script /var/adm/fillup-templates/")
|
||||
addFilter(" init-script-name-with-dot ")
|
||||
addFilter('.* statically-linked-binary /sbin/ldconfig')
|
||||
addFilter('.* statically-linked-binary /sbin/init')
|
||||
@ -200,6 +200,7 @@ addFilter(" non-devel-buildrequires python")
|
||||
addFilter(" non-devel-buildrequires ruby")
|
||||
addFilter(" non-devel-buildrequires valgrind")
|
||||
addFilter(" non-devel-buildrequires yasm")
|
||||
addFilter(" non-devel-buildrequires tcl")
|
||||
|
||||
addFilter("beagle-index\.\S+: \w: (non-devel|unnecessary)-buildrequires")
|
||||
addFilter("collect-desktop-files\.\S+: \w: (non-devel|unnecessary)-buildrequires")
|
||||
@ -225,3 +226,4 @@ addFilter(" invalid-build-requires ")
|
||||
addFilter(" no-provides ")
|
||||
|
||||
# config ends here
|
||||
|
||||
|
229
config.in
Normal file
229
config.in
Normal file
@ -0,0 +1,229 @@
|
||||
# -*- python -*-
|
||||
# Configuration for the rpmlint utility.
|
||||
# Loaded before ~/.rpmlintrc
|
||||
# $Id: config,v 1.39 2003/12/22 11:20:55 flepied Exp $
|
||||
|
||||
# This line is mandatory to access the configuration functions
|
||||
from Config import *
|
||||
|
||||
# Additionale path to look for checks
|
||||
|
||||
#addCheckDir("~/mandrake/rpmlint")
|
||||
|
||||
# Configure the checks if you don't want the default ones
|
||||
|
||||
allChecks()
|
||||
|
||||
addCheck("CheckBuildRoot")
|
||||
addCheck("CheckExecDocs")
|
||||
addCheck("CheckPkgConfig")
|
||||
addCheck("CheckCommonFiles")
|
||||
addCheck("CheckInitScripts")
|
||||
addCheck("DesktopTranslationCheck")
|
||||
addCheck("DuplicatesCheck")
|
||||
addCheck("LibraryPolicyCheck")
|
||||
addCheck("CheckIconSizes")
|
||||
#addCheck("CheckStaticLibraries")
|
||||
addCheck("BrandingPolicyCheck")
|
||||
|
||||
# stuff autobuild takes care about
|
||||
addFilter(".*invalid-version.*")
|
||||
addFilter(".*invalid-packager.*")
|
||||
addFilter(".*not-standard-release-extension.*")
|
||||
addFilter(".*non-standard-group.*")
|
||||
addFilter(".*invalid-buildhost.*")
|
||||
addFilter(".*executable-in-library-package.*")
|
||||
addFilter(".*non-versioned-file-in-library-package.*")
|
||||
addFilter(".*incoherent-version-in-name.*")
|
||||
addFilter(".*invalid-vendor.*")
|
||||
addFilter(".*invalid-distribution.*")
|
||||
|
||||
# Configuration options used by the checks
|
||||
|
||||
#setOption("Vendor", "MySelf")
|
||||
#setOption("Distribution", "MyDistrib")
|
||||
setOption("UseBzip2", 0)
|
||||
setOption("UseUTF8", 1)
|
||||
#setOption("ReleaseExtension", None)
|
||||
#setOption("ValidGroups", ("Group1", "Group2"))
|
||||
#setOption("KernelModuleRPMsOK", 0)
|
||||
|
||||
@STDGROUPS@
|
||||
@STDUSERS@
|
||||
|
||||
setOption('DanglingSymlinkExceptions',
|
||||
(['/usr/share/doc/licenses/', 'licenses'],
|
||||
['consolehelper$', 'usermode-consoleonly'],
|
||||
))
|
||||
|
||||
# Output filters
|
||||
addFilter(".*spurious-bracket-in-.*")
|
||||
addFilter(".*one-line-command-in-.*")
|
||||
addFilter(" dir-or-file-in-opt")
|
||||
addFilter("incoherent-version-in-changelog")
|
||||
addFilter(" no-signature")
|
||||
addFilter(" without-chkconfig")
|
||||
addFilter("unstripped-binary-or-object.*\.ko")
|
||||
addFilter(" no-chkconfig")
|
||||
addFilter(" subsys-not-used")
|
||||
addFilter(" dangerous-command.*")
|
||||
addFilter(" setuid-binary.*")
|
||||
addFilter(".*FSSTND-dir-in-var /var/adm/.*")
|
||||
addFilter("no-url-tag")
|
||||
addFilter("subdir-in-bin /sbin/conf.d/")
|
||||
addFilter(" invalid-license")
|
||||
addFilter(".* nss_db non-standard-dir-in-var db")
|
||||
addFilter("non-standard-dir-in-usr openwin")
|
||||
addFilter("ibcs2 non-standard-dir-in-usr i486-sysv4")
|
||||
addFilter("shlibs5 non-standard-dir-in-usr i486-linux-libc5")
|
||||
addFilter("filesystem dir-or-file")
|
||||
addFilter("filesystem hidden-")
|
||||
addFilter("explicit-lib-dependency libtool")
|
||||
|
||||
|
||||
# suppress any errors about internal packages
|
||||
addFilter("^qa\S+: [EWI]:")
|
||||
addFilter("^\S*(?:INTERNAL|internal)\.\S+: [EWI]:")
|
||||
|
||||
|
||||
# exceptions for devel-files
|
||||
addFilter("devel-file-in-non-devel-package.*/boot/vmlinuz-.*autoconf.h")
|
||||
addFilter("devel-file-in-non-devel-package.*/usr/src/linux-")
|
||||
addFilter("devel-file-in-non-devel-package.*/usr/share/systemtap")
|
||||
addFilter("kde4-kapptemplate\.\S+:.*devel-file-in-non-devel-package")
|
||||
addFilter("kdesdk3\.\S+:.*devel-file-in-non-devel-package")
|
||||
addFilter("-(?:examples|doc)\.\S+: \w: devel-file-in-non-devel-package")
|
||||
addFilter("java\S+-demo\.\S+: \w: devel-file-in-non-devel-package")
|
||||
addFilter('avr-libc\.\S+: \w: devel-file-in-non-devel-package')
|
||||
addFilter('dietlibc\.\S+ \w: devel-file-in-non-devel-package')
|
||||
addFilter('cross-.*devel-file-in-non-devel-package')
|
||||
addFilter('cmake.*devel-file-in-non-devel-package')
|
||||
addFilter('gcc\d\d.*devel-file-in-non-devel-package')
|
||||
addFilter('OpenOffice_org-sdk\.\S+: \w: devel-file-in-non-devel-package')
|
||||
addFilter('wnn-sdk\.\S+: \w: devel-file-in-non-devel-package')
|
||||
addFilter('ocaml\.\S+: \w: devel-file-in-non-devel-package')
|
||||
addFilter('xorg-x11-server-sdk\.\S+: \w: devel-file-in-non-devel-package')
|
||||
addFilter('linux-kernel-headers\.\S+: \w: devel-file-in-non-devel-package')
|
||||
addFilter(' devel-file-in-non-devel-package.*-config')
|
||||
addFilter('libtool\.\S+: \w: devel-file-in-non-devel-package')
|
||||
|
||||
addFilter('update-desktop-files\.\S+: \w: untranslated-desktop-file')
|
||||
addFilter("sdb.* dangling-relative-symlink /usr/share/doc/sdb/.*/gifs ../gifs")
|
||||
addFilter("kernel-modules-not-in-kernel-packages")
|
||||
addFilter("configure-without-libdir-spec")
|
||||
addFilter("conffile-without-noreplace-flag /etc/init.d")
|
||||
addFilter("use-of-RPM_SOURCE_DIR")
|
||||
addFilter(" info info-dir-file /usr/share/info/dir")
|
||||
addFilter("use-tmp-in-")
|
||||
addFilter("symlink-contains-up-and-down-segments /var/lib/named")
|
||||
addFilter("no-ldconfig-symlink")
|
||||
addFilter("aaa_base\.\S+: \w: use-of-home-in-%post")
|
||||
addFilter("description-line-too-long")
|
||||
addFilter("hardcoded-library-path")
|
||||
# addFilter("incoherent-subsys")
|
||||
# doesn't seem to make sense
|
||||
addFilter("invalid-ldconfig-symlink")
|
||||
addFilter("invalid-soname")
|
||||
addFilter("library-not-linked-against-libc")
|
||||
addFilter("only-non-binary-in-usr-lib")
|
||||
addFilter("outside-libdir-files")
|
||||
# we want these files
|
||||
addFilter(" perl-temp-file ")
|
||||
addFilter(" hidden-file-or-dir .*/\.packlist")
|
||||
addFilter(" hidden-file-or-dir .*/\.directory")
|
||||
addFilter("perl-.*no-binary")
|
||||
addFilter(" no-major-in-name ")
|
||||
# we check for that already
|
||||
addFilter("dangling-relative-symlink")
|
||||
addFilter(" lib-package-without-%mklibname")
|
||||
addFilter(" requires-on-release")
|
||||
addFilter(" non-executable-script /etc/profile.d/")
|
||||
addFilter(" non-executable-script /var/adm/fillup-templates/")
|
||||
addFilter(" init-script-name-with-dot ")
|
||||
addFilter('.* statically-linked-binary /sbin/ldconfig')
|
||||
addFilter('.* statically-linked-binary /sbin/init')
|
||||
addFilter('ldconfig-post.*/ddiwrapper/wine/')
|
||||
addFilter('glibc\.\S+: \w: statically-linked-binary /usr/sbin/glibc_post_upgrade')
|
||||
addFilter(" symlink-should-be-relative ")
|
||||
addFilter(" binary-or-shlib-defines-rpath .*ORIGIN")
|
||||
addFilter("libzypp.*shlib-policy-name-error.*libzypp")
|
||||
|
||||
# stuff that is currently too noisy, but might become relevant in the future
|
||||
addFilter(" file-not-utf8")
|
||||
addFilter(" tag-not-utf8")
|
||||
addFilter(" setup-not-quiet")
|
||||
addFilter(" no-cleaning-of-buildroot ")
|
||||
addFilter(" mixed-use-of-spaces-and-tabs ")
|
||||
addFilter(" prereq-use ")
|
||||
addFilter(" unversioned-explicit-provides ")
|
||||
addFilter(" unversioned-explicit-obsoletes ")
|
||||
addFilter(" no-%clean-section")
|
||||
addFilter(" service-default-enabled ")
|
||||
addFilter(" non-standard-dir-perm ")
|
||||
addFilter(" conffile-without-noreplace-flag ")
|
||||
addFilter(" non-standard-executable-perm ")
|
||||
addFilter(" jar-not-indexed ")
|
||||
addFilter(" non-conffile-in-etc ")
|
||||
addFilter(" uncompressed-zip ")
|
||||
addFilter(" %ifarch-applied-patch ")
|
||||
addFilter(" read-error ")
|
||||
addFilter(" init-script-without-chkconfig-postin ")
|
||||
addFilter(" init-script-without-chkconfig-preun ")
|
||||
addFilter(" postin-without-chkconfig ")
|
||||
addFilter(" preun-without-chkconfig ")
|
||||
addFilter(" no-dependency-on locales")
|
||||
addFilter(" incoherent-version-in-name")
|
||||
addFilter(" binary-or-shlib-defines-rpath")
|
||||
addFilter(" executable-marked-as-config-file")
|
||||
addFilter(" log-files-without-logrotate")
|
||||
addFilter(" hardcoded-prefix-tag")
|
||||
addFilter(" no-documentation")
|
||||
addFilter(" multiple-specfiles")
|
||||
addFilter(" apache2-naming-policy-not-applied")
|
||||
addFilter(" no-default-runlevel ")
|
||||
addFilter(" setgid-binary ")
|
||||
addFilter(" non-standard-gid ")
|
||||
addFilter(" non-readable ")
|
||||
addFilter(" manpage-not-bzipped ")
|
||||
addFilter(" postin-without-ghost-file-creation ")
|
||||
# bug 287090
|
||||
addFilter(" file-in-usr-marked-as-conffile")
|
||||
addFilter(" non-remote_fs-dependency.*/boot")
|
||||
|
||||
# exceptions for non-devel-buildrequires
|
||||
addFilter(" non-devel-buildrequires apache2-mod_perl")
|
||||
addFilter(" non-devel-buildrequires ksh")
|
||||
addFilter(" non-devel-buildrequires perl")
|
||||
addFilter(" non-devel-buildrequires php5")
|
||||
addFilter(" non-devel-buildrequires postfix")
|
||||
addFilter(" non-devel-buildrequires python")
|
||||
addFilter(" non-devel-buildrequires ruby")
|
||||
addFilter(" non-devel-buildrequires valgrind")
|
||||
addFilter(" non-devel-buildrequires yasm")
|
||||
addFilter(" non-devel-buildrequires tcl")
|
||||
|
||||
addFilter("beagle-index\.\S+: \w: (non-devel|unnecessary)-buildrequires")
|
||||
addFilter("collect-desktop-files\.\S+: \w: (non-devel|unnecessary)-buildrequires")
|
||||
addFilter("installation-images\.\S+: \w: (non-devel|unnecessary)-buildrequires")
|
||||
|
||||
# suboptimal library packaging
|
||||
addFilter(" non-devel-buildrequires graphviz")
|
||||
addFilter(" non-devel-buildrequires ImageMagick")
|
||||
addFilter(" non-devel-buildrequires aspell")
|
||||
addFilter(" non-devel-buildrequires autotrace")
|
||||
addFilter(" non-devel-buildrequires gettext")
|
||||
addFilter(" non-devel-buildrequires devhelp")
|
||||
addFilter(" non-devel-buildrequires libxml2")
|
||||
addFilter(" non-devel-buildrequires libxslt")
|
||||
addFilter(" non-devel-buildrequires recode")
|
||||
|
||||
|
||||
# many places have shorter paths
|
||||
addFilter(" non-coherent-filename ")
|
||||
|
||||
# mandriva specific stuff that we don't want
|
||||
addFilter(" invalid-build-requires ")
|
||||
addFilter(" no-provides ")
|
||||
|
||||
# config ends here
|
||||
|
19
fix-BinariesCheck-regex.diff
Normal file
19
fix-BinariesCheck-regex.diff
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
BinariesCheck.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: BinariesCheck.py
|
||||
===================================================================
|
||||
--- BinariesCheck.py.orig
|
||||
+++ BinariesCheck.py
|
||||
@@ -26,8 +26,8 @@ class BinaryInfo:
|
||||
needed_regex=re.compile('\s+\(NEEDED\).*\[(\S+)\]')
|
||||
rpath_regex=re.compile('\s+\(RPATH\).*\[(\S+)\]')
|
||||
soname_regex=re.compile('\s+\(SONAME\).*\[(\S+)\]')
|
||||
- comment_regex=re.compile('^\s+\[\d+\]\s+\.comment\s+')
|
||||
- pic_regex=re.compile('^\s+\[\d+\]\s+\.rela?\.(data|text)')
|
||||
+ comment_regex=re.compile('^\s+\[\s*\d+\]\s+\.comment\s+')
|
||||
+ pic_regex=re.compile('^\s+\[\s*\d+\]\s+\.rela?\.(data|text)')
|
||||
non_pic_regex=re.compile('TEXTREL', re.MULTILINE)
|
||||
undef_regex=re.compile('^undefined symbol:\s+(\S+)')
|
||||
unused_regex=re.compile('^\s+(\S+)')
|
40
locale-update.diff
Normal file
40
locale-update.diff
Normal file
@ -0,0 +1,40 @@
|
||||
--- I18NCheck.py
|
||||
+++ I18NCheck.py
|
||||
@@ -35,7 +35,7 @@ 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',
|
||||
+'af', 'am', 'ang', 'ar', 'as', 'az', 'az_IR', 'be', 'be@latin', 'bg', 'bn', 'bn_IN', 'br',
|
||||
'bs', 'ca', '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',
|
||||
--- I18NCheck.py
|
||||
+++ I18NCheck.py
|
||||
@@ -36,21 +36,21 @@ 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', 'be@latin', 'bg', 'bn', 'bn_IN', 'br',
|
||||
-'bs', 'ca', 'cs', 'cy', 'da', 'de', 'de_AT', 'dz', 'el',
|
||||
+'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',
|
||||
+'oc', 'or', 'pa_IN', 'ph', 'pl', 'pp', 'ps', 'pt', 'pt_BR', 'qu', 'ro', 'ru', 'rw',
|
||||
'sc', 'se', 'si', 'sk', 'sl', 'sq', 'sr', 'sr@Latn', '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',
|
@ -1,3 +1,27 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 21 15:27:08 CEST 2008 - dmueller@suse.de
|
||||
|
||||
- suppress script warnings about /var/adm/fillup-templates (bnc#379601)
|
||||
- add start of a branding policy checker
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 18 10:18:01 CEST 2008 - jblunck@suse.de
|
||||
|
||||
- Fix some regex in BinariesCheck
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 17 15:40:36 CEST 2008 - jblunck@suse.de
|
||||
|
||||
- Add symtab and debuginfo tests for static libs
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 13 18:37:33 CET 2008 - dmueller@suse.de
|
||||
|
||||
- autogenerate users/groups from autobuild (bnc#374601)
|
||||
- suppress non-devel buildrequire dependency for tcl
|
||||
- fix licenses symlink handling (bnc#370364)
|
||||
- allow /usr/share/locale/be@latin (bnc#370418)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 11 18:15:37 CET 2008 - dmueller@suse.de
|
||||
|
||||
|
25
rpmlint.spec
25
rpmlint.spec
@ -15,9 +15,10 @@ Name: rpmlint
|
||||
BuildRequires: rpm-python
|
||||
Summary: Rpm correctness checker
|
||||
Version: 0.82
|
||||
Release: 23
|
||||
Release: 34
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: config
|
||||
Source1001: config.in
|
||||
Source2: DesktopTranslationCheck.py
|
||||
Source3: DuplicatesCheck.py
|
||||
Source4: CheckBuildRoot.py
|
||||
@ -27,6 +28,7 @@ Source7: LibraryPolicyCheck.py
|
||||
Source8: CheckCommonFiles.py
|
||||
Source9: CheckInitScripts.py
|
||||
Source10: CheckIconSizes.py
|
||||
Source11: BrandingPolicyCheck.py
|
||||
Source100: syntax-validator.py
|
||||
Url: http://rpmlint.zarb.org/
|
||||
License: GPL v2 or later
|
||||
@ -83,6 +85,9 @@ Patch50: suse-no-run-ldconfig.diff
|
||||
Patch51: description-check.diff
|
||||
Patch52: suppress-for-perl-python.diff
|
||||
Patch53: no-dot-in-skel.diff
|
||||
Patch54: locale-update.diff
|
||||
Patch55: suse-debuginfo.diff
|
||||
Patch56: fix-BinariesCheck-regex.diff
|
||||
%py_requires
|
||||
|
||||
%description
|
||||
@ -145,6 +150,9 @@ Authors:
|
||||
%patch51
|
||||
%patch52
|
||||
%patch53
|
||||
%patch54
|
||||
%patch55
|
||||
%patch56
|
||||
# not yet, needs further support for recommends
|
||||
#%patch42
|
||||
cp -p %{SOURCE1} .
|
||||
@ -157,6 +165,7 @@ cp -p %{SOURCE7} .
|
||||
cp -p %{SOURCE8} .
|
||||
cp -p %{SOURCE9} .
|
||||
cp -p %{SOURCE10} .
|
||||
cp -p %{SOURCE11} .
|
||||
|
||||
%build
|
||||
make
|
||||
@ -182,6 +191,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/man/man1/rpmlint.1.gz
|
||||
|
||||
%changelog
|
||||
* Mon Apr 21 2008 dmueller@suse.de
|
||||
- suppress script warnings about /var/adm/fillup-templates (bnc#379601)
|
||||
- add start of a branding policy checker
|
||||
* Fri Apr 18 2008 jblunck@suse.de
|
||||
- Fix some regex in BinariesCheck
|
||||
* Thu Apr 17 2008 jblunck@suse.de
|
||||
- Add symtab and debuginfo tests for static libs
|
||||
* Thu Mar 13 2008 dmueller@suse.de
|
||||
- autogenerate users/groups from autobuild (bnc#374601)
|
||||
- suppress non-devel buildrequire dependency for tcl
|
||||
- fix licenses symlink handling (bnc#370364)
|
||||
- allow /usr/share/locale/be@latin (bnc#370418)
|
||||
* Tue Mar 11 2008 dmueller@suse.de
|
||||
- fix some false positives
|
||||
* Mon Mar 10 2008 dmueller@suse.de
|
||||
@ -371,7 +392,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- make the buildroot check work
|
||||
- make the buildroot check factor 10-15 faster
|
||||
- fix the pkgconfig check
|
||||
* Fri Jun 08 2007 dmueller@suse.de
|
||||
* Sat Jun 09 2007 dmueller@suse.de
|
||||
- fix warning-hide hack (#279865)
|
||||
- description update
|
||||
* Fri Jun 08 2007 dmueller@suse.de
|
||||
|
99
suse-debuginfo.diff
Normal file
99
suse-debuginfo.diff
Normal file
@ -0,0 +1,99 @@
|
||||
From: Jan Blunck <jblunck@suse.de>
|
||||
Subject: Add checks for static libraries missing symtab and debuginfo
|
||||
|
||||
Static libraries without a symbol table are not linkable. Binaries linking
|
||||
against static libraries without debuginfo are not debuggable.
|
||||
---
|
||||
BinariesCheck.py | 31 +++++++++++++++++++++++++++++--
|
||||
1 file changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: BinariesCheck.py
|
||||
===================================================================
|
||||
--- BinariesCheck.py.orig
|
||||
+++ BinariesCheck.py
|
||||
@@ -32,6 +32,8 @@ class BinaryInfo:
|
||||
undef_regex=re.compile('^undefined symbol:\s+(\S+)')
|
||||
unused_regex=re.compile('^\s+(\S+)')
|
||||
debug_file_regex=re.compile('\.debug$')
|
||||
+ debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+')
|
||||
+ symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+')
|
||||
|
||||
def __init__(self, pkg, path, file, is_ar):
|
||||
self.had_error=0
|
||||
@@ -42,6 +44,8 @@ class BinaryInfo:
|
||||
self.comment=0
|
||||
self.soname=0
|
||||
self.non_pic=1
|
||||
+ self.debuginfo=0
|
||||
+ self.symtab=0
|
||||
|
||||
is_debug=BinaryInfo.debug_file_regex.search(path)
|
||||
|
||||
@@ -65,6 +69,10 @@ class BinaryInfo:
|
||||
r=BinaryInfo.soname_regex.search(l)
|
||||
if r:
|
||||
self.soname=r.group(1)
|
||||
+ if BinaryInfo.debuginfo_regex.search(l):
|
||||
+ self.debuginfo=1
|
||||
+ if BinaryInfo.symtab_regex.search(l):
|
||||
+ self.symtab=1
|
||||
if self.non_pic:
|
||||
self.non_pic=BinaryInfo.non_pic_regex.search(res[1])
|
||||
else:
|
||||
@@ -114,6 +122,7 @@ shared_object_regex=re.compile('shared o
|
||||
executable_regex=re.compile('executable')
|
||||
libc_regex=re.compile('libc\.')
|
||||
ldso_soname_regex=re.compile('^ld(-linux(-(ia|x86_)64))?\.so')
|
||||
+ar_regex=re.compile('\.a$')
|
||||
so_regex=re.compile('/lib(64)?/[^/]+\.so(\.[0-9]+)*$')
|
||||
validso_regex=re.compile('(\.so\.\d+(\.\d+)*|\d\.so)$')
|
||||
sparc_regex=re.compile('SPARC32PLUS|SPARC V9|UltraSPARC')
|
||||
@@ -171,7 +180,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
|
||||
for i in info:
|
||||
is_elf = string.find(i[1], 'ELF') != -1
|
||||
- is_ar = string.find(i[1], 'current ar archive') != -1
|
||||
+ is_ar = ar_regex.search(i[0])
|
||||
is_ocaml_native = string.find(i[1], 'Objective caml native') != -1
|
||||
is_shell = string.find(i[1], "shell script") != -1
|
||||
is_binary = is_elf or is_ar or is_ocaml_native
|
||||
@@ -196,13 +205,23 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
|
||||
# stripped ?
|
||||
if not unstrippable.search(i[0]) and not is_ocaml_native:
|
||||
- if not_stripped.search(i[1]) and \
|
||||
+ if not is_ar and not_stripped.search(i[1]) and \
|
||||
(os.environ.get('BUILD_IS_RUNNING', None) == None or \
|
||||
os.environ.get('BUILD_DEBUG_FLAGS','').find('-g') != -1):
|
||||
printWarning(pkg, 'unstripped-binary-or-object', i[0])
|
||||
|
||||
# inspect binary file
|
||||
bin_info=BinaryInfo(pkg, pkg.dirName()+i[0], i[0], is_ar)
|
||||
+ # stripped static library
|
||||
+ if is_ar:
|
||||
+ if bin_info.had_error:
|
||||
+ pass
|
||||
+ elif not bin_info.symtab:
|
||||
+ printError(pkg, 'static-library-without-symtab', i[0])
|
||||
+ elif not bin_info.debuginfo and \
|
||||
+ (os.environ.get('BUILD_IS_RUNNING', None) == None or \
|
||||
+ os.environ.get('BUILD_DEBUG_FLAGS','').find('-g') != -1):
|
||||
+ printWarning(pkg, 'static-library-without-debuginfo', i[0])
|
||||
|
||||
# so name in library
|
||||
if so_regex.search(i[0]):
|
||||
@@ -441,6 +460,14 @@ with the intended shared libraries only.
|
||||
|
||||
'ldd-failed',
|
||||
'''Executing ldd on this file failed, all checks could not be run.''',
|
||||
+
|
||||
+'static-library-without-symtab',
|
||||
+'''The static library doesn't contain any symbols and therefore can't be linked
|
||||
+against. This may indicated that it was strip.''',
|
||||
+
|
||||
+'static-library-without-debuginfo',
|
||||
+'''The static library doesn't contain any debuginfo. Binaries linking against
|
||||
+this static library can't be properly debugged.''',
|
||||
)
|
||||
|
||||
# BinariesCheck.py ends here
|
@ -142,7 +142,7 @@
|
||||
'/usr/local/lib',
|
||||
'/usr/local/lib64',
|
||||
'/usr/local/man',
|
||||
@@ -100,24 +149,417 @@
|
||||
@@ -100,24 +149,415 @@
|
||||
'/usr/local/man/mann',
|
||||
'/usr/local/sbin',
|
||||
'/usr/local/share',
|
||||
@ -532,10 +532,8 @@
|
||||
+ '/usr/share/locale/urd/LC_MESSAGES',
|
||||
+ '/usr/share/locale/uz',
|
||||
+ '/usr/share/locale/uz/LC_MESSAGES',
|
||||
+ '/usr/share/locale/uz@Cyrl',
|
||||
+ '/usr/share/locale/uz@Cyrl/LC_MESSAGES',
|
||||
+ '/usr/share/locale/uz@Latn',
|
||||
+ '/usr/share/locale/uz@Latn/LC_MESSAGES',
|
||||
+ '/usr/share/locale/uz@cyrillic',
|
||||
+ '/usr/share/locale/uz@cyrillic/LC_MESSAGES',
|
||||
+ '/usr/share/locale/ve',
|
||||
+ '/usr/share/locale/ve/LC_MESSAGES',
|
||||
+ '/usr/share/locale/ven',
|
||||
@ -571,7 +569,7 @@
|
||||
'/usr/share/man',
|
||||
'/usr/share/man/man1',
|
||||
'/usr/share/man/man2',
|
||||
@@ -129,28 +571,60 @@
|
||||
@@ -129,28 +569,60 @@
|
||||
'/usr/share/man/man8',
|
||||
'/usr/share/man/man9',
|
||||
'/usr/share/man/mann',
|
||||
|
Loading…
Reference in New Issue
Block a user