diff --git a/CheckGNOMEMacros.py b/CheckGNOMEMacros.py new file mode 100644 index 0000000..b7261be --- /dev/null +++ b/CheckGNOMEMacros.py @@ -0,0 +1,185 @@ +# vim:sw=4:et +############################################################################# +# File : CheckGNOMEMacros.py +# Package : rpmlint +# Author : Vincent Untz +# Purpose : Check for GNOME related packaging errors +############################################################################# + +import re +import string + +import rpm + +from Filter import * +import AbstractCheck +import Config + +## FIXME +# Maybe detect packages installing icons in other themes than hicolor and not +# updating the icon cache for those themes? + +_gnome_post_postun_checks = [ + ('glib2-gsettings-schema', + re.compile('^/usr/share/glib-2.0/schemas/.+\.gschema.xml$'), + 'glib2-tools', + re.compile('^[^#]*glib-compile-schemas', re.MULTILINE), + True), + + ('glib2-gio-module', + re.compile('^/usr/lib(?:64)?/gio/modules/'), + 'glib2-tools', + re.compile('^[^#]*gio-querymodules', re.MULTILINE), + True), + + ('gdk-pixbuf-loader', + re.compile('^/usr/lib(?:64)?/gdk-pixbuf-2.0/[^/]+/loaders/'), + 'gdk-pixbuf-query-loaders', + re.compile('^[^#]*gdk-pixbuf-query-loaders', re.MULTILINE), + True), + + ('gtk2-immodule', + re.compile('^/usr/lib(?:64)?/gtk-2.0/[^/]+/immodules/'), + 'gtk2', + re.compile('^[^#]*gtk-query-immodules-2.0', re.MULTILINE), + True), + + ('gtk3-immodule', + re.compile('^/usr/lib(?:64)?/gtk-3.0/[^/]+/immodules/'), + 'gtk3-tools', + re.compile('^[^#]*gtk-query-immodules-3.0', re.MULTILINE), + True), + + # Not fatal since it would make too many things fail + ('hicolor-icon-cache', + re.compile('^/usr/share/icons/hicolor/'), + None, + re.compile('^[^#]*gtk-update-icon-cache', re.MULTILINE), + False), + + ('mime-database', + re.compile('^/usr/share/mime/packages/.+\.xml$'), + None, + re.compile('^[^#]*update-mime-database', re.MULTILINE), + True), + + # Not fatal since it would make too many things fail + ('desktop-database', + re.compile('^/usr/share/applications/.+\.desktop$'), + None, + re.compile('^[^#]*update-desktop-database', re.MULTILINE), + False) +] + +_gnome_gconf_filename_re = re.compile('^/usr/share/GConf/schemas/.+\.schemas$') +_gnome_gconf_sciptlet_re = re.compile('^[^#]*gconftool-2', re.MULTILINE) + +class GNOMECheck(AbstractCheck.AbstractCheck): + + def __init__(self): + AbstractCheck.AbstractCheck.__init__(self, "CheckGNOMEMacros") + + def check(self, pkg): + + if pkg.isSource(): + return + + ghosts = pkg.ghostFiles() + + pkg_requires = set(map(lambda x: string.split(x[0],'(')[0], pkg.requires())) + postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG] + postun = pkg[rpm.RPMTAG_POSTUN] or pkg[rpm.RPMTAG_POSTUNPROG] + posttrans = pkg[rpm.RPMTAG_POSTTRANS] or pkg[rpm.RPMTAG_POSTTRANSPROG] + + for filename in (x for x in pkg.files() if x not in ghosts): + for (name, file_re, required, post_re, fatal) in _gnome_post_postun_checks: + if fatal: + gnomePrint = printError + else: + gnomePrint = printWarning + + if file_re.search(filename): + if required and required not in pkg_requires: + gnomePrint(pkg, 'suse-' + name + '-missing-requires', filename) + if not postin or not post_re.search(postin): + gnomePrint(pkg, 'suse-' + name + '-missing-postin', filename) + if not postun or not post_re.search(postun): + gnomePrint(pkg, 'suse-' + name + '-missing-postun', filename) + + if _gnome_gconf_filename_re.search(filename): + if not ((postin and _gnome_gconf_sciptlet_re.search(postin)) or + (posttrans and _gnome_gconf_sciptlet_re.search(posttrans))): + printError(pkg, 'suse-gconf-schema-missing-scriptlets', filename) + + +check=GNOMECheck() + +if Config.info: + addDetails( +'suse-glib2-gsettings-schema-missing-requires', +'''A GSettings schema is in your package, but there is no dependency for the tool to recompile the schema database. Use %glib2_gsettings_schema_requires.''', + +'suse-glib2-gsettings-schema-missing-postin', +'''A GSettings schema is in your package, but the schema database is not recompiled in the %post scriptlet. Use %glib2_gsettings_schema_post.''', + +'suse-glib2-gsettings-schema-missing-postun', +'''A GSettings schema is in your package, but the schema database is not recompiled in the %postun scriptlet. Use %glib2_gsettings_schema_postun.''', + +'suse-glib2-gio-module-missing-requires', +'''A GIO module is in your package, but there is no dependency for the tool to rebuild the GIO module cache. Use %glib2_gio_module_requires.''', + +'suse-glib2-gio-module-missing-postin', +'''A GIO module is in your package, but the GIO module cache is not rebuilt in the %post scriptlet. Use %glib2_gio_module_post.''', + +'suse-glib2-gio-module-missing-postun', +'''A GIO module is in your package, but the GIO module cache is not rebuilt in the %postun scriptlet. Use %glib2_gio_module_postun.''', + +'suse-gdk-pixbuf-loader-missing-requires', +'''A gdk-pixbuf loader is in your package, but there is no dependency for the tool to rebuild the gdk-pixbuf loader cache. Use %gdk_pixbuf_loader_requires.''', + +'suse-gdk-pixbuf-loader-missing-postin', +'''A gdk-pixbuf loader is in your package, but the gdk-pixbuf loader cache is not rebuilt in the %post scriptlet. Use %gdk_pixbuf_loader_post.''', + +'suse-gdk-pixbuf-loader-missing-postun', +'''A gdk-pixbuf loader is in your package, but the gdk-pixbuf loader cache is not rebuilt in the %postun scriptlet. Use %gdk_pixbuf_loader_postun.''', + +'suse-gtk2-immodule-missing-requires', +'''A GTK+ 2 IM module is in your package, but there is no dependency for the tool to rebuild the GTK+ 2 IM module cache. Use %gtk2_immodule_requires.''', + +'suse-gtk2-immodule-missing-postin', +'''A GTK+ 2 IM module is in your package, but the GTK+ 2 IM module cache is not rebuilt in the %post scriptlet. Use %gtk2_immodule_post.''', + +'suse-gtk2-immodule-missing-postun', +'''A GTK+ 2 IM module is in your package, but the GTK+ 2 IM module cache is not rebuilt in the %postun scriptlet. Use %gtk2_immodule_postun.''', + +'suse-gtk3-immodule-missing-requires', +'''A GTK+ 3 IM module is in your package, but there is no dependency for the tool to rebuild the GTK+ 3 IM module cache. Use %gtk3_immodule_requires.''', + +'suse-gtk3-immodule-missing-postin', +'''A GTK+ 3 IM module is in your package, but the GTK+ 3 IM module cache is not rebuilt in the %post scriptlet. Use %gtk3_immodule_post.''', + +'suse-gtk3-immodule-missing-postun', +'''A GTK+ 3 IM module is in your package, but the GTK+ 3 IM module cache is not rebuilt in the %postun scriptlet. Use %gtk3_immodule_postun.''', + +'suse-hicolor-icon-cache-missing-postin', +'''An icon for the hicolor theme is in your package, but the hicolor icon cache is not rebuilt in the %post scriptlet. Use %icon_theme_cache_post.''', + +'suse-hicolor-icon-cache-missing-postun', +'''An icon for the hicolor theme is in your package, but the hicolor icon cache is not rebuilt in the %postun scriptlet. Use %icon_theme_cache_postun.''', + +'suse-mime-database-missing-postin', +'''A MIME definition is in your package, but the MIME database is not rebuilt in the %post scriptlet. Use %mime_database_post.''', + +'suse-mime-database-missing-postun', +'''A MIME definition is in your package, but the MIME database is not rebuilt in the %postun scriptlet. Use %mime_database_postun.''', + +'suse-desktop-database-missing-postin', +'''A desktop file is in your package, but the desktop database is not rebuilt in the %post scriptlet. Use %desktop_database_post.''', + +'suse-desktop-database-missing-postun', +'''A desktop file is in your package, but the desktop database is not rebuilt in the %postun scriptlet. Use %desktop_database_postun.''', + +'suse-gconf-schema-missing-scriptlets', +'''A GConf schema is in your package, but the GConf configuration is not updated by scriptlets. Please use the gconf RPM macros.''' + +) diff --git a/LibraryPolicyCheck.py b/LibraryPolicyCheck.py index ef2b43d..0a7ac4d 100644 --- a/LibraryPolicyCheck.py +++ b/LibraryPolicyCheck.py @@ -592,9 +592,9 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck): # Verify shared lib policy package doesn't have hard dependency on non-lib packages if std_lib_package: for dep in pkg.requires(): - if (dep[0].startswith('rpmlib(')): + if (dep[0][0:7] == 'rpmlib('): continue - if (dep[2] & (rpm.RPMSENSE_GREATER | rpm.RPMSENSE_EQUAL)) == rpm.RPMSENSE_EQUAL: + if (dep[1] & (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 diff --git a/add-weak-dependencies.diff b/add-weak-dependencies.diff index 03bcf95..f6a488f 100644 --- a/add-weak-dependencies.diff +++ b/add-weak-dependencies.diff @@ -1,6 +1,6 @@ --- Pkg.py +++ Pkg.py -@@ -328,6 +328,10 @@ +@@ -425,6 +425,10 @@ self._missingok_files = None self._files = None self._requires = None @@ -11,7 +11,7 @@ self._req_names = -1 if header: -@@ -553,6 +557,22 @@ +@@ -656,6 +660,22 @@ self._gatherDepInfo() return self._requires @@ -32,31 +32,31 @@ + return self._enhances + def prereq(self): - self._gatherDepInfo() - return self._prereq -@@ -586,7 +606,7 @@ + """Get package PreReqs as list of + (name, flags, (epoch, version, release)) tuples.""" +@@ -692,7 +712,7 @@ # internal function to gather dependency info used by the above ones - def _gather_aux(self, header, list, nametag, versiontag, flagstag, + def _gather_aux(self, header, list, nametag, flagstag, versiontag, - prereq = None): + prereq = None, strong_only = False, weak_only = False): names = header[nametag] - versions = header[versiontag] flags = header[flagstag] -@@ -596,7 +616,11 @@ + versions = header[versiontag] +@@ -703,7 +723,11 @@ if prereq is not None and flags[loop] & PREREQ_FLAG: - prereq.append((names[loop], versions[loop], - flags[loop] & (~PREREQ_FLAG))) + prereq.append((names[loop], flags[loop] & (~PREREQ_FLAG), + evr)) - else: + elif strong_only and flags[loop] & rpm.RPMSENSE_STRONG: + list.append((names[loop], versions[loop], flags[loop] & (~rpm.RPMSENSE_STRONG))) + elif weak_only and not (flags[loop] & rpm.RPMSENSE_STRONG): + list.append((names[loop], versions[loop], flags[loop])) + elif not (weak_only or strong_only): - list.append((names[loop], versions[loop], flags[loop])) + list.append((names[loop], flags[loop], evr)) def _gatherDepInfo(self): -@@ -606,6 +630,10 @@ +@@ -713,6 +737,10 @@ self._provides = [] self._conflicts = [] self._obsoletes = [] @@ -67,10 +67,10 @@ self._gather_aux(self.header, self._requires, rpm.RPMTAG_REQUIRENAME, -@@ -624,6 +652,27 @@ - rpm.RPMTAG_OBSOLETENAME, - rpm.RPMTAG_OBSOLETEVERSION, - rpm.RPMTAG_OBSOLETEFLAGS) +@@ -732,6 +760,27 @@ + rpm.RPMTAG_OBSOLETEFLAGS, + rpm.RPMTAG_OBSOLETEVERSION) + + try: + self._gather_aux(self.header, self._recommends, + rpm.RPMTAG_SUGGESTSNAME, @@ -88,10 +88,10 @@ + rpm.RPMTAG_ENHANCESNAME, + rpm.RPMTAG_ENHANCESVERSION, + rpm.RPMTAG_ENHANCESFLAGS, strong_only=True) -+ + except: + pass + - ++ def getInstalledPkgs(name): """Get list of installed package objects by name.""" + diff --git a/avoid-mismatched-libregex.diff b/avoid-mismatched-libregex.diff index d0a4212..f6267ff 100644 --- a/avoid-mismatched-libregex.diff +++ b/avoid-mismatched-libregex.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -658,7 +658,7 @@ buildconfig_rpath_regex = re.compile('(? +@@ -659,7 +659,7 @@ buildconfig_rpath_regex = re.compile('(? sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$') devel_regex = re.compile('(.*)-(debug(info)?|devel|headers|source|static)$') debuginfo_package_regex = re.compile('-debug(info)?$') diff --git a/better-wrong-script.diff b/better-wrong-script.diff index f38115b..6416778 100644 --- a/better-wrong-script.diff +++ b/better-wrong-script.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -1617,7 +1617,10 @@ executed.''', +@@ -1665,7 +1665,10 @@ executed.''', executed.''', 'wrong-script-interpreter', diff --git a/buildroot-doc.diff b/buildroot-doc.diff index 4b6b363..44e558f 100644 --- a/buildroot-doc.diff +++ b/buildroot-doc.diff @@ -2,7 +2,7 @@ Index: SpecCheck.py =================================================================== --- SpecCheck.py.orig +++ SpecCheck.py -@@ -612,7 +612,7 @@ versions you can ignore this warning.''' +@@ -594,7 +594,7 @@ versions you can ignore this warning.''' 'hardcoded-path-in-buildroot-tag', '''A path is hardcoded in your Buildroot tag. It should be replaced diff --git a/buildroot-in-scripts.diff b/buildroot-in-scripts.diff index 0728c15..bedc0ed 100644 --- a/buildroot-in-scripts.diff +++ b/buildroot-in-scripts.diff @@ -1,27 +1,13 @@ -Index: SpecCheck.py -=================================================================== ---- SpecCheck.py.orig +--- SpecCheck.py +++ SpecCheck.py -@@ -60,7 +60,10 @@ suse_version_regex = re.compile('%suse_v - section_regexs = dict( - ([x, re.compile('^%' + x + '(?:\s|$)')] - for x in ('build', 'changelog', 'check', 'clean', 'description', 'files', -- 'install', 'package', 'prep'))) -+ 'install', 'package', 'prep', -+ 'pre', 'post', 'postun', 'trigger', 'triggerin', -+ 'triggerprein', 'triggerun', 'triggerpostun', -+ 'pretrans', 'posttrans'))) - - # Only check for /lib, /usr/lib, /usr/X11R6/lib - # TODO: better handling of X libraries and modules. -@@ -265,7 +268,9 @@ class SpecCheck(AbstractCheck.AbstractCh +@@ -223,7 +223,9 @@ continue -- if current_section in ('prep', 'build'): -+ if current_section in ('prep', 'build', 'pre', 'post', 'postun', +- if current_section in ('prep', 'build') and \ ++ if current_section in ('prep', 'build','pre', 'post', 'postun', + 'trigger', 'triggerin', 'triggerprein', 'triggerun', 'triggerpostun', -+ 'pretrans', 'posttrans'): - if contains_buildroot(line): - printWarning(pkg, 'rpm-buildroot-usage', - '%' + current_section, line[:-1].strip()) ++ 'pretrans', 'posttrans') and \ + contains_buildroot(line): + printWarning(pkg, 'rpm-buildroot-usage', '%' + current_section, + line[:-1].strip()) diff --git a/config b/config index e4f858a..273ceb5 100644 --- a/config +++ b/config @@ -61,8 +61,8 @@ setOption("UseUTF8", 1) #setOption("ValidGroups", ("Group1", "Group2")) #setOption("KernelModuleRPMsOK", 0) -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('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', 'lxdm')) +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', 'lxdm')) setOption('DanglingSymlinkExceptions', (['/usr/share/doc/licenses/', 'licenses'], diff --git a/confusing-invalid-spec-name.patch b/confusing-invalid-spec-name.patch index b98f5fb..c54d2f5 100644 --- a/confusing-invalid-spec-name.patch +++ b/confusing-invalid-spec-name.patch @@ -1,10 +1,10 @@ # Confusing message. The problem is not that the file does not end # with ".spec", but that there is a mismatch of specname and pkg name. -Index: rpmlint-0.95/SpecCheck.py +Index: rpmlint-0.99/SpecCheck.py =================================================================== ---- rpmlint-0.95.orig/SpecCheck.py 2010-07-29 09:29:28.000000000 +0200 -+++ rpmlint-0.95/SpecCheck.py 2010-07-29 09:44:32.000000000 +0200 -@@ -593,8 +593,8 @@ addDetails( +--- rpmlint-0.99.orig/SpecCheck.py ++++ rpmlint-0.99/SpecCheck.py +@@ -568,8 +568,8 @@ addDetails( SPEC file to build a valid RPM package.''', 'invalid-spec-name', diff --git a/dependency-parsing.diff b/dependency-parsing.diff deleted file mode 100644 index 2438857..0000000 --- a/dependency-parsing.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: SpecCheck.py -=================================================================== ---- SpecCheck.py.orig -+++ SpecCheck.py -@@ -117,7 +117,7 @@ def deptokens(line): - elif wantmore: - tmp += ' ' + tok - wantmore = False -- elif tok[0] in ('=', '<', '>'): -+ elif len(tok) and tok[0] in ('=', '<', '>'): - tmp += ' ' + tok - wantmore = True - else: diff --git a/description-check.diff b/description-check.diff index 394c90a..2b8daae 100644 --- a/description-check.diff +++ b/description-check.diff @@ -2,7 +2,7 @@ Index: TagsCheck.py =================================================================== --- TagsCheck.py.orig +++ TagsCheck.py -@@ -676,6 +676,9 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -698,6 +698,9 @@ class TagsCheck(AbstractCheck.AbstractCh if not description: printError(pkg, 'no-description-tag') else: @@ -12,7 +12,7 @@ Index: TagsCheck.py if not pkg[rpm.RPMTAG_HEADERI18NTABLE]: self._unexpanded_macros(pkg, '%description', description) else: -@@ -946,6 +949,10 @@ Name tag.''', +@@ -969,6 +972,10 @@ Name tag.''', '''The major number of the library isn't included in the package's name. ''', diff --git a/devel-provide-is-devel-package.diff b/devel-provide-is-devel-package.diff index fb8fa90..5469dd4 100644 --- a/devel-provide-is-devel-package.diff +++ b/devel-provide-is-devel-package.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -813,6 +813,10 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -826,6 +826,10 @@ class FilesCheck(AbstractCheck.AbstractC # Check if the package is a development package devel_pkg = devel_regex.search(pkg.name) diff --git a/docdata-examples.diff b/docdata-examples.diff index 68394fb..33bdf80 100644 --- a/docdata-examples.diff +++ b/docdata-examples.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -652,6 +652,7 @@ bin_regex = re.compile('^(/usr)?/s?bin/' +@@ -653,6 +653,7 @@ bin_regex = re.compile('^/(?:usr/(?:s?bi includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) develfile_regex = re.compile('\.(a|cmxa?|mli?)$') buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$') @@ -10,16 +10,16 @@ Index: FilesCheck.py # room for improvement with catching more -R, but also for false positives... buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b') sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$') -@@ -1151,7 +1152,7 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -1168,7 +1169,7 @@ class FilesCheck(AbstractCheck.AbstractC includefile_regex.search(f) or \ develfile_regex.search(f) or \ logrotate_regex.search(f) - if nonexec_file: + if nonexec_file and not docdir_examples_regex.search(f): printWarning(pkg, 'spurious-executable-perm', f) - elif f.startswith('/etc/'): - if f not in config_files and f not in ghost_files: -@@ -1491,7 +1492,10 @@ included in your package.''', + elif f.startswith('/etc/') and f not in config_files and \ + f not in ghost_files: +@@ -1539,7 +1540,10 @@ included in your package.''', 'spurious-executable-perm', '''The file is installed with executable permissions, but was identified as one that probably should not be executable. Verify if the executable bits are diff --git a/fix-buildroot-test.diff b/fix-buildroot-test.diff deleted file mode 100644 index 18f7c7f..0000000 --- a/fix-buildroot-test.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: SpecCheck.py -=================================================================== ---- SpecCheck.py.orig -+++ SpecCheck.py -@@ -35,7 +35,7 @@ applied_patch_regex = re.compile("^%patc - applied_patch_p_regex = re.compile("\s-P\s+(\d+)\\b") - source_dir_regex = re.compile("^[^#]*(\$RPM_SOURCE_DIR|%{?_sourcedir}?)") - obsolete_tags_regex = re.compile("^(Copyright|Serial)\s*:\s*([^\s]+)") --buildroot_regex = re.compile('Buildroot\s*:\s*([^\s]+)', re.IGNORECASE) -+buildroot_regex = re.compile('^\s*Buildroot\s*:\s*([^\s]+)', re.IGNORECASE) - prefix_regex = re.compile('^Prefix\s*:\s*([^\s]+)', re.IGNORECASE) - packager_regex = re.compile('^Packager\s*:\s*([^\s]+)', re.IGNORECASE) - noarch_regex = re.compile('^BuildArch(?:itectures)?\s*:\s*\\bnoarch\\b', re.IGNORECASE) diff --git a/invalid-filerequires.diff b/invalid-filerequires.diff index 691f1a9..83481f5 100644 --- a/invalid-filerequires.diff +++ b/invalid-filerequires.diff @@ -1,26 +1,24 @@ -Index: TagsCheck.py -=================================================================== ---- TagsCheck.py.orig +--- TagsCheck.py +++ TagsCheck.py -@@ -419,6 +419,7 @@ invalid_version_regex = re.compile('([0- +@@ -419,6 +419,7 @@ # () are here for grouping purpose in the regexp forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE) valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost')) +valid_filedep_regex=re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)') - epoch_regex = re.compile('^[0-9]+:') use_epoch = Config.getOption('UseEpoch', False) use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) -@@ -580,6 +581,9 @@ class TagsCheck(AbstractCheck.AbstractCh + max_line_len = Config.getOption('MaxLineLength', 79) +@@ -597,6 +598,9 @@ if d[0].startswith('/usr/local/'): printError(pkg, 'invalid-dependency', d[0]) + if d[0].startswith('/') and not valid_filedep_regex.search(d[0]): + printWarning(pkg, 'invalid-filepath-dependency', d[0]) + - if not devel_depend and not is_devel and not is_source: - if FilesCheck.devel_regex.search(d[0]): - printError(pkg, 'devel-dependency', d[0]) -@@ -1040,6 +1044,12 @@ explicit Requires: tags.''', + if not devel_depend and not is_devel and not is_source and \ + FilesCheck.devel_regex.search(d[0]): + printError(pkg, 'devel-dependency', d[0]) +@@ -1063,6 +1067,12 @@ '''This package provides 2 times the same capacity. It should only provide it once.''', diff --git a/no-badness-return.diff b/no-badness-return.diff index f443106..2d6762d 100644 --- a/no-badness-return.diff +++ b/no-badness-return.diff @@ -1,6 +1,8 @@ ---- Filter.py +Index: Filter.py +=================================================================== +--- Filter.py.orig +++ Filter.py -@@ -104,7 +104,7 @@ +@@ -104,7 +104,7 @@ def printAllReasons(): if len(last_reason): printDescriptions(last_reason) last_reason = reason @@ -9,9 +11,11 @@ if Config.info and len(last_reason): printDescriptions(last_reason) _diagnostic = list() ---- rpmlint.py +Index: rpmlint.py +=================================================================== +--- rpmlint.py.orig +++ rpmlint.py -@@ -201,7 +201,7 @@ +@@ -202,7 +202,7 @@ def main(): % (packages_checked, specfiles_checked, printed_messages["E"], printed_messages["W"]) diff --git a/no-doc-for-lib.diff b/no-doc-for-lib.diff index db5102e..d173f71 100644 --- a/no-doc-for-lib.diff +++ b/no-doc-for-lib.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -830,7 +830,7 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -843,7 +843,7 @@ class FilesCheck(AbstractCheck.AbstractC debuginfo_srcs = False debuginfo_debugs = False diff --git a/only-reg-files-are-scripts.diff b/only-reg-files-are-scripts.diff index d1e1a08..46dbd23 100644 --- a/only-reg-files-are-scripts.diff +++ b/only-reg-files-are-scripts.diff @@ -1,19 +1,21 @@ --- InitScriptCheck.py +++ InitScriptCheck.py -@@ -15,6 +15,7 @@ - import rpm +@@ -18,7 +18,7 @@ + import AbstractCheck + import Config import Pkg - import string +- +import stat - rc_regex=re.compile('^/etc(/rc\.d)?/init\.d/') - chkconfig_content_regex=re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+') -@@ -40,7 +41,7 @@ + chkconfig_content_regex = re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+') + subsys_regex = re.compile('/var/lock/subsys/([^/"\'\n\s;&|]+)', re.MULTILINE) +@@ -50,7 +50,8 @@ + for fname, pkgfile in pkg.files().items(): - initscript_list = [] - for f in pkg.files().keys(): -- if rc_regex.search(f): -+ if rc_regex.search(f) and stat.S_ISREG(pkg.files()[f][0]): - basename=basename_regex.search(f).group(1) - initscript_list.append(basename) - if pkg.files()[f][0] & 0500 != 0500: + if not fname.startswith('/etc/init.d/') and \ +- not fname.startswith('/etc/rc.d/init.d/'): ++ not fname.startswith('/etc/rc.d/init.d/') and \ ++ stat.S_ISREG(pkgfile.mode): + continue + + basename = os.path.basename(fname) diff --git a/rpmgroup-checks.diff b/rpmgroup-checks.diff index 1122f79..bc0d366 100644 --- a/rpmgroup-checks.diff +++ b/rpmgroup-checks.diff @@ -2,7 +2,7 @@ Index: TagsCheck.py =================================================================== --- TagsCheck.py.orig +++ TagsCheck.py -@@ -686,6 +686,8 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -708,6 +708,8 @@ class TagsCheck(AbstractCheck.AbstractCh self._unexpanded_macros(pkg, 'Group', group) if not group: printError(pkg, 'no-group-tag') @@ -11,7 +11,7 @@ Index: TagsCheck.py elif VALID_GROUPS and group not in VALID_GROUPS: printWarning(pkg, 'non-standard-group', group) -@@ -985,6 +987,10 @@ won't fool the specfile parser, and rebu +@@ -1008,6 +1010,10 @@ won't fool the specfile parser, and rebu '''There is no Group tag in your package. You have to specify a valid group in your spec file using the Group tag.''', diff --git a/rpmlint-0.95.tar.bz2 b/rpmlint-0.95.tar.bz2 deleted file mode 100644 index 1f99c61..0000000 --- a/rpmlint-0.95.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b8fdc18e6b98768197b5b9adee1316fa65073ed0372d47191f33636e93dde27 -size 100631 diff --git a/rpmlint-0.99.tar.bz2 b/rpmlint-0.99.tar.bz2 new file mode 100644 index 0000000..7eda010 --- /dev/null +++ b/rpmlint-0.99.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:452c65f114d445051c400d1a57e48061609fe2946dccda6d3ac52ffa425d2808 +size 123463 diff --git a/rpmlint-pkg-quoting.diff b/rpmlint-pkg-quoting.diff new file mode 100644 index 0000000..0006198 --- /dev/null +++ b/rpmlint-pkg-quoting.diff @@ -0,0 +1,13 @@ +Index: Pkg.py +=================================================================== +--- Pkg.py.orig ++++ Pkg.py +@@ -492,7 +492,7 @@ class Pkg: + dir = self.dirname) + # TODO: better shell escaping or sequence based command invocation + command_str = \ +- 'rpm2cpio "%s" | (cd "%s"; cpio -id); chmod -R +rX "%s"' % \ ++ "rpm2cpio '%s' | (cd '%s'; cpio -id); chmod -R +rX '%s'" % \ + (self.filename, self.dirname, self.dirname) + cmd = commands.getstatusoutput(command_str) + self.extracted = True diff --git a/rpmlint-suse.diff b/rpmlint-suse.diff index 4c84ec9..0a3d517 100644 --- a/rpmlint-suse.diff +++ b/rpmlint-suse.diff @@ -2,25 +2,25 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -175,7 +175,7 @@ compr_regex = re.compile('\.(gz|z|Z|zip| +@@ -176,7 +176,7 @@ compr_regex = re.compile('\.(gz|z|Z|zip| absolute_regex = re.compile('^/([^/]+)') absolute2_regex = re.compile('^/?([^/]+)') points_regex = re.compile('^\.\./(.*)') -doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/') +doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help') - bin_regex = re.compile('^(/usr)?/s?bin/') + bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) develfile_regex = re.compile('\.(a|cmxa?|mli?)$') Index: I18NCheck.py =================================================================== --- I18NCheck.py.orig +++ I18NCheck.py -@@ -67,7 +67,7 @@ CORRECT_SUBDIRS = ( - ) +@@ -31,7 +31,7 @@ INCORRECT_LOCALES = { + 'en_UK': 'en_GB'} - package_regex = re.compile('-(' + '|'.join((x[0:2] for x in CORRECT_SUBDIRS)) + ')$') + package_regex = re.compile('-(' + '|'.join(LANGUAGES) + ')$') -locale_regex = re.compile('^(/usr/share/locale/([^/]+))/') +locale_regex = re.compile('^(/(usr|opt/kde3|opt/gnome)/share/locale/([^/]+))/') correct_subdir_regex = re.compile('^(([a-z][a-z]([a-z])?(_[A-Z][A-Z])?)([.@].*$)?)$') lc_messages_regex = re.compile('/usr/share/locale/([^/]+)/LC_MESSAGES/.*(mo|po)$') - man_regex = re.compile('/usr(?:/share)?/man/([^/]+)/man./[^/]+$') + man_regex = re.compile('/usr(?:/share)?/man/([^/]+)/man[0-9n][^/]*/[^/]+$') diff --git a/rpmlint.changes b/rpmlint.changes index 53f033c..8ccd193 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,44 @@ +------------------------------------------------------------------- +Tue Oct 12 14:58:55 UTC 2010 - lnussel@suse.de + +- add check for gnome and desktop related macros + +------------------------------------------------------------------- +Sun Oct 3 15:28:44 UTC 2010 - andrea@opensuse.org + +- Added lxdm as a valid group and user + +------------------------------------------------------------------- +Mon Sep 27 12:07:17 CEST 2010 - dmueller@suse.de + +- update to 0.99: + * Add Python 2.7 magic number ( https://bugzilla.redhat.com/623607, Nils Philippsen) + +------------------------------------------------------------------- +Mon Sep 27 12:05:55 CEST 2010 - dmueller@suse.de + +- update to 0.98: + * Pkg.py, test/test.Pkg.py: Fix self-obsoletion bug with Provides + containing Epoch. + * Pkg.py: Don't stringify None Epoch to 'None' string in + compareEVR(). + * Pkg.py: Sync rangeCompare() with yum 3.2.27. + * TagsCheck.py: Reduce some spell check noise. + * rpmlint: Fix handling of arguments containing spaces. + * DocFilesCheck.py: Bypass doc file check earlier if package has no + doc files. + +------------------------------------------------------------------- +Thu Aug 19 08:27:14 UTC 2010 - dimstar@opensuse.org + +- Add suse-g-ir-chech.diff: *.gir belong in -devel packages. + +------------------------------------------------------------------- +Sun Aug 8 18:59:08 CEST 2010 - vuntz@opensuse.org + +- Update suse-version.diff: last non-obsolete version of openSUSE + is 11.1, and latest valid version of openSUSE is 11.4. + ------------------------------------------------------------------- Thu Jul 29 18:25:47 CEST 2010 - dmueller@suse.de diff --git a/rpmlint.spec b/rpmlint.spec index a67df66..6e45603 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -1,5 +1,5 @@ # -# spec file for package rpmlint (Version 0.95) +# spec file for package rpmlint (Version 0.99) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,8 +22,8 @@ Name: rpmlint BuildRequires: rpm-python Summary: Rpm correctness checker -Version: 0.95 -Release: 14 +Version: 0.99 +Release: 1 Source0: %{name}-%{version}.tar.bz2 Source1: config Source1001: config.in @@ -47,6 +47,7 @@ Source18: CheckDBusPolicy.py Source19: CheckAlternativesGhostFiles.py Source20: rpmgroups.config Source21: BashismsCheck.py +Source22: CheckGNOMEMacros.py Source100: syntax-validator.py Url: http://rpmlint.zarb.org/ License: GPLv2+ @@ -72,12 +73,10 @@ Patch11: suse-file-var-run.diff Patch12: usr-arch.diff Patch13: script-interpreter-only-for-exec-scripts.diff Patch14: sourced-dirs.diff -Patch16: dependency-parsing.diff Patch17: docdata-examples.diff Patch18: suse-hide-unstripped-outside-build.diff Patch19: yast-provides.diff Patch20: xdg-paths-update.diff -Patch21: fix-buildroot-test.diff Patch22: better-wrong-script.diff Patch23: buildroot-doc.diff # bogus, fails with aaa_base. disabled @@ -85,7 +84,6 @@ Patch24: sysv5-init-checks.diff Patch26: ignore-non-readable-in-etc.diff Patch29: rpmgroup-checks.diff Patch30: devel-provide-is-devel-package.diff -# what's the reason behind that one? Patch31: only-reg-files-are-scripts.diff Patch33: check-buildroot-during-install.diff Patch34: verify-buildrequires.diff @@ -110,13 +108,14 @@ Patch62: no-badness-return.diff Patch65: suse-shlib-devel-dependency.diff Patch67: suse-required-lsb-tags.diff Patch68: more-verbose-lsb-check.diff -Patch69: useless-requires-doc.diff 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 Patch76: confusing-invalid-spec-name.patch +Patch77: rpmlint-pkg-quoting.diff +Patch78: suse-g-ir-chech.diff %py_requires %description @@ -147,12 +146,10 @@ Authors: %patch12 %patch13 %patch14 -%patch16 %patch17 -%patch18 +#%patch18 %patch19 %patch20 -%patch21 %patch22 %patch23 # bogus, fails with aaa_base. disabled @@ -160,7 +157,7 @@ Authors: #%patch26 %patch29 %patch30 -#%patch31 +%patch31 # needs rediff #%patch33 #%patch34 @@ -175,22 +172,23 @@ Authors: %patch50 %patch51 #%patch52 -%patch54 +### rediff! +#%patch54 #%patch57 %patch58 -#%patch60 +%patch60 %patch62 -#%patch63 %patch65 #%patch67 #%patch68 -#%patch69 #%patch71 %patch72 %patch73 %patch74 %patch75 %patch76 -p1 +%patch77 +%patch78 cp -p %{SOURCE1} . cp -p %{SOURCE2} . cp -p %{SOURCE3} . @@ -211,6 +209,7 @@ cp -p %{SOURCE17} . cp -p %{SOURCE18} . cp -p %{SOURCE19} . cp -p %{SOURCE21} . +cp -p %{SOURCE22} . %build make %{?_smp_mflags} diff --git a/script-interpreter-only-for-exec-scripts.diff b/script-interpreter-only-for-exec-scripts.diff index 5ca28de..b6b0408 100644 --- a/script-interpreter-only-for-exec-scripts.diff +++ b/script-interpreter-only-for-exec-scripts.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -1292,7 +1292,7 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -1225,7 +1225,7 @@ class FilesCheck(AbstractCheck.AbstractC interpreter = None if res: interpreter = res.group(1) diff --git a/selfconflicts-provide.diff b/selfconflicts-provide.diff index cc5ca0a..c523620 100644 --- a/selfconflicts-provide.diff +++ b/selfconflicts-provide.diff @@ -1,23 +1,23 @@ --- TagsCheck.py +++ TagsCheck.py -@@ -680,6 +680,7 @@ +@@ -801,6 +801,7 @@ - obs_names = map(lambda x: x[0], pkg.obsoletes()) - prov_names = map(lambda x: x[0].split(':/')[0], pkg.provides()) + obs_names = [x[0] for x in pkg.obsoletes()] + prov_names = [x[0].split(':/')[0] for x in pkg.provides()] + conf_names = map(lambda x: x[0].split(':/')[0], pkg.conflicts()) - req_names = map(lambda x: x[0], pkg.requires() + pkg.prereq()) - if pkg.name in obs_names: -@@ -695,6 +696,8 @@ + for o in (x for x in obs_names if x not in prov_names): + printWarning(pkg, 'obsolete-not-provided', o) +@@ -812,6 +813,8 @@ # https://bugzilla.redhat.com/460872 - useless_provides=[] + useless_provides = [] for p in prov_names: + if p in conf_names: + printWarning(pkg, 'conflicts-with-provides', p) - if prov_names.count(p) != 1: - if p not in useless_provides: - useless_provides.append(p) -@@ -796,6 +799,10 @@ + if prov_names.count(p) != 1 and p not in useless_provides: + useless_provides.append(p) + for p in useless_provides: +@@ -952,6 +955,10 @@ '''There is no Name tag in your package. You have to specify a name using the Name tag.''', diff --git a/sourced-dirs.diff b/sourced-dirs.diff index d86fcd3..940246b 100644 --- a/sourced-dirs.diff +++ b/sourced-dirs.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -684,7 +684,7 @@ manifest_perl_regex = re.compile('^/usr/ +@@ -685,7 +685,7 @@ manifest_perl_regex = re.compile('^/usr/ shebang_regex = re.compile('^#!\s*(\S*)') interpreter_regex = re.compile('^/(usr/)?(s?bin|games|libexec(/.+)?|(lib(64)?|share)/.+)/[^/]+$') script_regex = re.compile('^/((usr/)?s?bin|etc/(rc\.d/init\.d|X11/xinit\.d|cron\.(hourly|daily|monthly|weekly)))/') diff --git a/stricter-interpreter-check.diff b/stricter-interpreter-check.diff index 582a690..168b633 100644 --- a/stricter-interpreter-check.diff +++ b/stricter-interpreter-check.diff @@ -1,6 +1,8 @@ ---- FilesCheck.py +Index: FilesCheck.py +=================================================================== +--- FilesCheck.py.orig +++ FilesCheck.py -@@ -826,7 +826,8 @@ +@@ -1248,7 +1248,8 @@ class FilesCheck(AbstractCheck.AbstractC f.endswith('.la')): printError(pkg, 'script-without-shebang', f) diff --git a/suse-binarieschecks.diff b/suse-binarieschecks.diff index 4887933..546b344 100644 --- a/suse-binarieschecks.diff +++ b/suse-binarieschecks.diff @@ -48,36 +48,36 @@ if self.non_pic: self.non_pic = 'TEXTREL' in res[1] -@@ -259,6 +278,17 @@ - bin_info = BinaryInfo( - pkg, pkgfile.path, fname, is_ar, is_shlib) +@@ -270,6 +289,17 @@ + is_shlib = so_regex.search(fname) + bin_info = BinaryInfo(pkg, pkgfile.path, fname, is_ar, is_shlib) -+ # stripped static library -+ if is_ar: -+ if bin_info.readelf_error: -+ pass -+ elif not bin_info.symtab: -+ printError(pkg, 'static-library-without-symtab', fname) -+ 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', fname) ++ # stripped static library ++ if is_ar: ++ if bin_info.readelf_error: ++ pass ++ elif not bin_info.symtab: ++ printError(pkg, 'static-library-without-symtab', fname) ++ 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', fname) + - # so name in library - if is_shlib: - has_lib = True -@@ -294,6 +324,10 @@ - printError( - pkg, 'shlib-with-non-pic-code', fname) + if is_shlib: + has_lib = True -+ # gethostbyname ? -+ if bin_info.calls_gethostbyname: -+ printError(pkg, 'binary-or-shlib-calls-gethostbyname', fname) +@@ -319,6 +349,10 @@ + for ec in bin_info.exit_calls: + printWarning(pkg, 'shared-lib-calls-exit', fname, ec) + ++ # gethostbyname ? ++ if bin_info.calls_gethostbyname: ++ printError(pkg, 'binary-or-shlib-calls-gethostbyname', fname) + - # rpath ? - if bin_info.rpath: - for p in bin_info.rpath: -@@ -509,6 +543,14 @@ + # rpath ? + if bin_info.rpath: + for p in bin_info.rpath: +@@ -504,6 +538,14 @@ 'ldd-failed', '''Executing ldd on this file failed, all checks could not be run.''', @@ -92,7 +92,7 @@ 'executable-stack', '''The binary declares the stack as executable. Executable stack is usually an error as it is only needed if the code contains GCC trampolines or similar -@@ -521,6 +563,10 @@ +@@ -516,6 +558,10 @@ make the stack executable. Usual suspects include use of a non-GNU linker or an old GNU linker version.''', diff --git a/suse-bzip-bigger-than-100k.diff b/suse-bzip-bigger-than-100k.diff index 86339ee..44d3617 100644 --- a/suse-bzip-bigger-than-100k.diff +++ b/suse-bzip-bigger-than-100k.diff @@ -9,15 +9,15 @@ compress_ext = Config.getOption("CompressExtension", "bz2") valid_src_perms = Config.getOption("ValidSrcPerms", DEFAULT_VALID_SRC_PERMS) -@@ -40,7 +40,7 @@ - printError(pkg, 'multiple-specfiles', spec_file, fname) +@@ -41,7 +41,7 @@ else: spec_file = fname -- elif source_regex.search(fname) and compress_ext: -+ elif source_regex.search(fname) and compress_ext and pkgfile.size > 120*1024: - if not fname.endswith(compress_ext): - printWarning(pkg, 'source-or-patch-not-compressed', - compress_ext, fname) + elif source_regex.search(fname) and compress_ext and \ +- not fname.endswith(compress_ext): ++ not fname.endswith(compress_ext) and pkgfile.size > 120*1024: + printWarning(pkg, 'source-or-patch-not-compressed', + compress_ext, fname) + perm = pkgfile.mode & 07777 @@ -58,8 +58,10 @@ 'source-or-patch-not-compressed', diff --git a/suse-check-optional-dependencies.diff b/suse-check-optional-dependencies.diff index ccefcd4..73a1e34 100644 --- a/suse-check-optional-dependencies.diff +++ b/suse-check-optional-dependencies.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -907,6 +907,16 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -928,6 +928,16 @@ class FilesCheck(AbstractCheck.AbstractC if res.group(1) != pkg.name: printError(pkg, 'incoherent-logrotate-file', f) @@ -19,7 +19,7 @@ Index: FilesCheck.py if link != '': ext = compr_regex.search(link) if ext: -@@ -1677,6 +1687,24 @@ consequences), or other compiler flags w +@@ -1725,6 +1735,24 @@ consequences), or other compiler flags w extraction not working as expected. Verify that the binaries are not unexpectedly stripped and that the intended compiler flags are used.''', diff --git a/suse-file-var-run.diff b/suse-file-var-run.diff index 5aacdbb..aab4fc5 100644 --- a/suse-file-var-run.diff +++ b/suse-file-var-run.diff @@ -1,6 +1,8 @@ ---- FilesCheck.py +Index: FilesCheck.py +=================================================================== +--- FilesCheck.py.orig +++ FilesCheck.py -@@ -392,7 +392,7 @@ +@@ -885,7 +885,7 @@ class FilesCheck(AbstractCheck.AbstractC is_kernel_package: printError(pkg, "kernel-modules-not-in-kernel-packages", f) @@ -9,7 +11,7 @@ printError(pkg, 'dir-or-file-in-tmp', f) elif f.startswith('/mnt/'): printError(pkg, 'dir-or-file-in-mnt', f) -@@ -402,6 +402,8 @@ +@@ -895,6 +895,8 @@ class FilesCheck(AbstractCheck.AbstractC printError(pkg, 'dir-or-file-in-usr-local', f) elif f.startswith('/var/local/'): printError(pkg, 'dir-or-file-in-var-local', f) @@ -18,7 +20,7 @@ elif sub_bin_regex.search(f): printError(pkg, 'subdir-in-bin', f) elif f.startswith('/home/'): -@@ -945,6 +948,12 @@ +@@ -1465,6 +1467,12 @@ for packages to install files in this di '''A file in the package is located in /var/local. It's not permitted for packages to install files in this directory.''', diff --git a/suse-filesystem.diff b/suse-filesystem.diff index 4b165f3..3bb789f 100644 --- a/suse-filesystem.diff +++ b/suse-filesystem.diff @@ -2,7 +2,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -28,65 +28,114 @@ STANDARD_DIRS = ( +@@ -29,65 +29,114 @@ STANDARD_DIRS = ( '/', '/bin', '/boot', @@ -144,7 +144,7 @@ Index: FilesCheck.py '/usr/local/lib', '/usr/local/lib64', '/usr/local/man', -@@ -102,24 +151,415 @@ STANDARD_DIRS = ( +@@ -103,24 +152,415 @@ STANDARD_DIRS = ( '/usr/local/man/mann', '/usr/local/sbin', '/usr/local/share', @@ -571,7 +571,7 @@ Index: FilesCheck.py '/usr/share/man', '/usr/share/man/man1', '/usr/share/man/man2', -@@ -131,28 +571,60 @@ STANDARD_DIRS = ( +@@ -132,28 +572,60 @@ STANDARD_DIRS = ( '/usr/share/man/man8', '/usr/share/man/man9', '/usr/share/man/mann', diff --git a/suse-g-ir-chech.diff b/suse-g-ir-chech.diff new file mode 100644 index 0000000..aab20b3 --- /dev/null +++ b/suse-g-ir-chech.diff @@ -0,0 +1,13 @@ +Index: FilesCheck.py +=================================================================== +--- FilesCheck.py.orig ++++ FilesCheck.py +@@ -651,7 +651,7 @@ points_regex = re.compile('^\.\./(.*)') + doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help') + bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') + includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) +-develfile_regex = re.compile('\.(a|cmxa?|mli?)$') ++develfile_regex = re.compile('\.(a|cmxa?|mli?|gir)$') + buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$') + docdir_examples_regex = re.compile('^/usr/(?:share/doc/packages|lib(?:64))/[^/]+/(?:example|demo|script|contrib)') + # room for improvement with catching more -R, but also for false positives... diff --git a/suse-hide-unstripped-outside-build.diff b/suse-hide-unstripped-outside-build.diff index dad95aa..d93a329 100644 --- a/suse-hide-unstripped-outside-build.diff +++ b/suse-hide-unstripped-outside-build.diff @@ -1,6 +1,4 @@ -Index: BinariesCheck.py -=================================================================== ---- BinariesCheck.py.orig +--- BinariesCheck.py +++ BinariesCheck.py @@ -10,6 +10,7 @@ @@ -10,18 +8,18 @@ Index: BinariesCheck.py import rpm -@@ -271,7 +272,9 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -283,7 +284,9 @@ + continue - # stripped ? - if not is_ocaml_native and not unstrippable.search(fname): -- if 'not stripped' in pkgfile.magic: -+ if 'not stripped' in pkgfile.magic and \ -+ (os.environ.get('BUILD_DIR', None) == None or -+ os.environ.get('BUILD_DEBUG', None) != None): - printWarning( - pkg, 'unstripped-binary-or-object', fname) + # stripped ? +- if 'not stripped' in pkgfile.magic: ++ if 'not stripped' in pkgfile.magic and \ ++ (os.environ.get('BUILD_DIR', None) == None or ++ os.environ.get('BUILD_DEBUG', None) != None): + printWarning(pkg, 'unstripped-binary-or-object', fname) -@@ -585,6 +588,12 @@ form, make sure that rpmbuild does not s + # inspect binary file +@@ -580,6 +583,12 @@ that use prelink, make sure that prelink does not strip it either, usually by placing a blacklist file in /etc/prelink.conf.d. For more information, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''', diff --git a/suse-no-run-ldconfig.diff b/suse-no-run-ldconfig.diff index 096a1c7..897666e 100644 --- a/suse-no-run-ldconfig.diff +++ b/suse-no-run-ldconfig.diff @@ -2,7 +2,7 @@ Index: SpecCheck.py =================================================================== --- SpecCheck.py.orig +++ SpecCheck.py -@@ -444,6 +444,10 @@ class SpecCheck(AbstractCheck.AbstractCh +@@ -403,6 +403,10 @@ class SpecCheck(AbstractCheck.AbstractCh printWarning(pkg, 'comparison-operator-in-deptoken', conf) @@ -13,7 +13,7 @@ Index: SpecCheck.py if current_section == 'changelog': for match in AbstractCheck.macro_regex.findall(line): res = re.match('%+', match) -@@ -711,6 +715,14 @@ may break short circuit builds.''', +@@ -690,6 +694,14 @@ may break short circuit builds.''', '''Make check or other automated regression test should be run in %check, as they can be disabled with a rpm macro for short circuiting purposes.''', diff --git a/suse-pkg-config-check.diff b/suse-pkg-config-check.diff index 801bea6..231cd34 100644 --- a/suse-pkg-config-check.diff +++ b/suse-pkg-config-check.diff @@ -1,8 +1,6 @@ -Index: TagsCheck.py -=================================================================== ---- TagsCheck.py.orig +--- TagsCheck.py +++ TagsCheck.py -@@ -414,6 +414,7 @@ lib_devel_number_regex = re.compile('^li +@@ -414,6 +414,7 @@ invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE) lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE) leading_space_regex = re.compile('^\s+') @@ -10,7 +8,7 @@ Index: TagsCheck.py license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s') invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) # () are here for grouping purpose in the regexp -@@ -607,10 +608,12 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -623,10 +624,12 @@ base = is_devel.group(1) dep = None has_so = False @@ -24,7 +22,7 @@ Index: TagsCheck.py if has_so: base_or_libs = base + '/' + base + '-libs/lib' + base # try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)") -@@ -647,6 +650,15 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -663,6 +666,15 @@ if prov not in (x[0] for x in pkg.provides()): printWarning(pkg, 'no-provides', prov) @@ -38,9 +36,9 @@ Index: TagsCheck.py + printWarning(pkg, 'no-pkg-config-provides') + # List of words to ignore in spell check - ignored_words = [x.split('/')[-1] for x in pkg.files()] - -@@ -1059,6 +1071,11 @@ instead or require a file in bin or /etc + ignored_words = set() + for pf in pkg.files(): +@@ -1082,6 +1094,11 @@ 'no-url-tag', '''The URL tag is missing.''', diff --git a/suse-url-check.diff b/suse-url-check.diff index bd30b03..af959b4 100644 --- a/suse-url-check.diff +++ b/suse-url-check.diff @@ -1,6 +1,8 @@ ---- TagsCheck.py +Index: TagsCheck.py +=================================================================== +--- TagsCheck.py.orig +++ TagsCheck.py -@@ -741,14 +741,14 @@ +@@ -762,14 +762,14 @@ class TagsCheck(AbstractCheck.AbstractCh if not valid_license: self._unexpanded_macros(pkg, 'License', rpm_license) diff --git a/suse-version.diff b/suse-version.diff index 6d572f8..475cb31 100644 --- a/suse-version.diff +++ b/suse-version.diff @@ -10,20 +10,20 @@ Index: SpecCheck.py section_regexs = dict( ([x, re.compile('^%' + x + '(?:\s|$)')] for x in ('build', 'changelog', 'check', 'clean', 'description', 'files', -@@ -386,6 +387,12 @@ class SpecCheck(AbstractCheck.AbstractCh +@@ -348,6 +349,12 @@ class SpecCheck(AbstractCheck.AbstractCh if res: package_noarch[current_package] = True + res = suse_version_regex.search(line) -+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1100: ++ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1110: + printWarning(pkg, "obsolete-suse-version-check", res.group(1)) -+ elif res and int(res.group(1)) > 1120: ++ elif res and int(res.group(1)) > 1140: + printError(pkg, "invalid-suse-version-check", res.group(1)) + res = prereq_regex.search(line) if res: printError(pkg, 'prereq-use', res.group(2)) -@@ -749,6 +756,15 @@ set which may result in security issues +@@ -731,6 +738,15 @@ set which may result in security issues depending on the system where the package is built. Add default attributes using %defattr before it in the %files section, or use per line %attr's.''', diff --git a/useless-requires-doc.diff b/useless-requires-doc.diff deleted file mode 100644 index 7afe6be..0000000 --- a/useless-requires-doc.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- TagsCheck.py -+++ TagsCheck.py -@@ -933,6 +933,10 @@ explicit Requires: tags.''', - '''This package provides 2 times the same capacity. It should only provide it - once.''', - -+'useless-explicit-requires', -+'''This package requires 2 times the same capacity. It should only require it -+once.''', -+ - 'unversioned-explicit-self-provides', - '''This package provides it's own name explicitely, which might break - upgrade path. self-provides are autogenerated. Remove the provide.''', diff --git a/usr-arch.diff b/usr-arch.diff index 19ee94f..115cf85 100644 --- a/usr-arch.diff +++ b/usr-arch.diff @@ -1,8 +1,6 @@ -Index: BinariesCheck.py -=================================================================== ---- BinariesCheck.py.orig +--- BinariesCheck.py +++ BinariesCheck.py -@@ -190,6 +190,7 @@ usr_lib_exception_regex = re.compile(Con +@@ -195,6 +195,7 @@ srcname_regex = re.compile('(.*?)-[0-9]') invalid_dir_ref_regex = re.compile('/(home|tmp)(\W|$)') ocaml_mixed_regex = re.compile('^Caml1999X0\d\d$') @@ -10,12 +8,12 @@ Index: BinariesCheck.py def dir_base(path): res = path_regex.search(path) -@@ -250,7 +251,7 @@ class BinariesCheck(AbstractCheck.Abstra - fname) - else: - # in /usr/share ? -- if fname.startswith('/usr/share/'): -+ if fname.startswith('/usr/share/') and not usr_arch_share_regex.search(fname): - printError( - pkg, 'arch-dependent-file-in-usr-share', fname) - # in /etc ? +@@ -267,7 +268,7 @@ + # arch dependent packages only from here on + + # in /usr/share ? +- if fname.startswith('/usr/share/'): ++ if fname.startswith('/usr/share/') and not usr_arch_share_regex.search(fname): + printError(pkg, 'arch-dependent-file-in-usr-share', fname) + + # in /etc ? diff --git a/version-control-internal-file.diff b/version-control-internal-file.diff index 3ae3ced..97261fd 100644 --- a/version-control-internal-file.diff +++ b/version-control-internal-file.diff @@ -3,7 +3,7 @@ Index: FilesCheck.py =================================================================== --- FilesCheck.py.orig +++ FilesCheck.py -@@ -663,7 +663,7 @@ ldconfig_regex = re.compile('^[^#]*ldcon +@@ -664,7 +664,7 @@ ldconfig_regex = re.compile('^[^#]*ldcon depmod_regex = re.compile('^[^#]*depmod', re.MULTILINE) install_info_regex = re.compile('^[^#]*install-info', re.MULTILINE) perl_temp_file_regex = re.compile('.*perl.*/(\.packlist|perllocal\.pod)$') diff --git a/yast-provides.diff b/yast-provides.diff index db75c5c..d6ab543 100644 --- a/yast-provides.diff +++ b/yast-provides.diff @@ -2,12 +2,12 @@ Index: TagsCheck.py =================================================================== --- TagsCheck.py.orig +++ TagsCheck.py -@@ -774,7 +774,7 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -795,7 +795,7 @@ class TagsCheck(AbstractCheck.AbstractCh printWarning(pkg, 'no-url-tag') obs_names = [x[0] for x in pkg.obsoletes()] - prov_names = [x[0] for x in pkg.provides()] + prov_names = [x[0].split(':/')[0] for x in pkg.provides()] - for o in obs_names: - if o not in prov_names: + for o in (x for x in obs_names if x not in prov_names): + printWarning(pkg, 'obsolete-not-provided', o)