From f5297aab9e9bb018ba3a0c8a47ef34733fea2a51cf849eeb1cee606e00d20cab Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 5 Dec 2011 15:02:02 +0000 Subject: [PATCH] - fix invalid-suse-version-chec (bnc#732671) OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=75 --- LibraryPolicyCheck.py | 269 +++++++++++++++++++++++------------------- rpmlint.changes | 5 + suse-version.diff | 2 +- 3 files changed, 154 insertions(+), 122 deletions(-) diff --git a/LibraryPolicyCheck.py b/LibraryPolicyCheck.py index e5efe04..512fae9 100644 --- a/LibraryPolicyCheck.py +++ b/LibraryPolicyCheck.py @@ -17,128 +17,145 @@ import os import string import Pkg -_policy_legacy_exceptions = ( - "libacl1", - "libaio1", - "libalut0", - "libapr-1-0", - "libaprutil-1-0", - "libartskde1", - "libattr1", - "libcdaudio1", - "libcdk4", - "libcheck0", - "libchewing3", - "libchm0", - "libclucene0", - "libdar4", - "libdbh-4_5-4", - "libdbus-qt-1-1", - "libdm0", - "libdns_sd1", - "libefence0", - "libEMF1", - "libevolutionglue", - "libf2c0", - "libffi4", - "libflaim5_2", - "libfontenc1", - "libfreeradius-client2", - "libgcc_s1", - "libgcc_s4", # only for hppa - "libgconfmm-2_6-1", - "libgfortran3", - "libgif4", - "libgimpprint1", - "libgladesharpglue-2", - "libglibsharpglue-2", - "libgltt0", - "libglut3", - "libGLw1", - "libgmcop1", - "libgnet-2_0-0", - "libgnomecanvasmm-2_6-1", - "libgnomecups-1_0-1", - "libgnomemm-2_6-1", - "libgnomeprintui-2-2-0", - "libgnomesharpglue-2", - "libgnomeuimm-2_6-1", - "libgomp1", - "libgsfglue", - "libgsf-gnome-1-114", - "libgtksourceview-1_0-0", - "libgtkspell0", - "libhangul0", - "libICE6", - "libid3-3_8-3", - "libid3tag0", - "libidn11", - "libiec61883-0", - "libieee1284-3", - "libilbc0", - "libind_helper0", - "libiterm1", - "libjackasyn0", - "libkakasi2", - "libkeyutils1", - "libksba8", - "liblo0", - "libmal0", - "libmcrypt4", - "libmdbodbc0", - "libmeanwhile1", - "libmhash2", - "libmikmod2", - "libmng1", - "libnet6-1_3-0", - "libnl1", - "libnscd1", - "libobjc3", - "libodbcinstQ1", - "liboil-0_3-0", - "liboop4", - "libopenal0", - "libpgeasy3", - "libportaudio2", - "libqnotify0", - "libQt3Support4", - "libqtc1", - "libqtsharp0", - "libQtSql4", - "libquadmath0", - "librdf0", - "librsync1", - "libsamplerate0", - "libsecprog0", - "libsexy2", - "libsigc-1_2-5", - "libSM6", - "libsndfile1", +_policy_every_version_exceptions = ( + "libstdc++5", "libstdc++6", - "libstroke0", - "libthai0", - "libutempter0", - "libvisual-0_4-0", - "libXau6", - "libxclass0_9_2", - "libXdmcp6", - "libXext6", - "libxfce4util4", - "libxfcegui4-4", - "libXfixes3", - "libxflaim3_2", - "libXiterm1", - "libxkbfile1", - "libxml2-2", - "libXp6", - "libXprintUtil1", - "libXrender1", - "libXt6", - "libXv1", - "libz1", - "libzio0" + "libgcc_s4", + "libgcc_s1", + "libffi4", + "libgfortran1", + "libgfortran3", ) +_policy_legacy_exceptions = { + "libEMF1" : ('1.0',), + "libGLw1" : ('7.10.2',), + "libICE6" : ('7.6',), + "libQt3Support4" : ('4.7.1', '4.7.4', '4.5.2+4.5.20101130', + '4.6.3+4.6.20110927', '4.7.4+4.7.20110929', + '4.7.80+4.8.20110818'), + "libQtSql4" : ('4.7.1', '4.7.4', '4.5.2+4.5.20101130', + '4.6.3+4.6.20110927', '4.7.4+4.7.20110929', + '4.7.80+4.8.20110818'), + "libSM6" : ('7.6',), + "libXau6" : ('7.6',), + "libXdmcp6" : ('7.6',), + "libXext6" : ('7.6',), + "libXfixes3" : ('7.6',), + "libXiterm1" : ('0.5.20040304',), + "libXp6" : ('7.6',), + "libXprintUtil1" : ('7.6',), + "libXrender1" : ('7.6',), + "libXt6" : ('7.6',), + "libXv1" : ('7.6',), + "libacl1" : ('2.2.51',), + "libaio1" : ('0.3.109',), + "libalut0" : ('1.1.0',), + "libapr-1-0" : ('1.4.5',), + "libaprutil-1-0" : ('1.3.12',), + "libartskde1" : ('3.5.10',), + "libattr1" : ('2.4.46',), + "libcdaudio1" : ('0.99.12',), + "libcdk4" : ('4.9.13',), + "libcheck0" : ('0.9.8',), + "libchewing3" : ('0.3.3',), + "libchm0" : ('0.40',), + "libclucene0" : ('0.9.21',), + "libdar4" : ('2.3.6',), + "libdbh-4_5-4" : ('4.5.0',), + "libdbus-qt-1-1" : ('4.7.1', '4.7.4', '4.5.2+4.5.20101130', + '4.6.3+4.6.20110927', '4.7.4+4.7.20110929', + '4.7.80+4.8.20110818'), + "libdm0" : ('2.2.10',), + "libdns_sd1" : ('0.6.25',), + "libefence0" : ('2.2.2',), + "libevolutionglue" : ('0.21.1',), + "libf2c0" : ('0.11',), + "libffi4" : ('4.4.2_20100116', '4.5.3_20110428', '4.6.1_20110926'), + "libflaim5_2" : ('4.9.1046',), + "libfontenc1" : ('7.6',), + "libfreeradius-client2" : ('1.1.6',), + "libgcc_s1" : ('4.4.2_20100116', '4.5.3_20110428', '4.6.1_20110926'), + # libgcc_s4 only for hppa + "libgcc_s4" : ('4.4.2_20100116', '4.5.3_20110428', '4.6.1_20110926'), + "libgconfmm-2_6-1" : ('2.28.2',), + "libgfortran3" : ('4.4.2_20100116', '4.5.3_20110428','4.6.1_20110926'), + "libgif4" : ('4.1.6',), + "libgimpprint1" : ('4.2.7',), + "libgladesharpglue-2" : ('2.12.10',), + "libglibsharpglue-2" : ('2.12.10',), + "libgltt0" : ('2.5.2',), + "libglut3" : ('100529',), + "libgmcop1" : ('1.5.10',), + "libgnomesharpglue-2" : ('2.24.2',), + "libgnet-2_0-0" : ('2.0.8',), + "libgnomecanvasmm-2_6-1" : ('2.26.0',), + "libgnomecups-1_0-1" : ('0.2.3',), + "libgnomemm-2_6-1" : ('2.30.0',), + "libgnomeprintui-2-2-0" : ('2.18.4',), + "libgnomeuimm-2_6-1" : ('2.26.0',), + "libgomp1" : ('4.4.2_20100116', '4.5.3_20110428', '4.6.1_20110926'), + "libgsfglue" : ('0.8.1',), + "libgsf-gnome-1-114" : ('1.14.21',), + "libgtksourceview-1_0-0" : ('3.2.0',), + "libgtkspell0" : ('2.0.16',), + "libhangul0" : ('0.0.12',), + "libid3-3_8-3" : ('3.8.3',), + "libid3tag0" : ('0.15.1b',), + "libidn11" : ('1.22',), + "libiec61883-0" : ('1.1.0',), + "libieee1284-3" : ('0.2.11',), + "libilbc0" : ('3951-107.1',), + "libind_helper0" : ('0.4.2',), + "libiterm1" : ('0.5.20040304',), + "libjackasyn0" : ('0.12',), + "libkakasi2" : ('2.3.4',), + "libkeyutils1" : ('1.5.3',), + "libksba8" : ('1.2.0',), + "liblo0" : ('0.25',), + "libmal0" : ('0.31',), + "libmcrypt4" : ('2.5.8',), + "libmdbodbc0" : ('0.6pre1',), + "libmeanwhile1" : ('1.0.2',), + "libmhash2" : ('0.9.9.9',), + "libmikmod2" : ('3.1.12',), + "libmng1" : ('1.0.10',), + "libnet6-1_3-0" : ('1.1.5',), + "libnl1" : ('1.1',), + "libnscd1" : ('2.0.2',), + "libobjc3" : ('4.4.2_20100116', '4.5.3_20110428', '4.6.1_20110926'), + "libodbcinstQ1" : ('10.2.0.4',), + "liboil-0_3-0" : ('0.3.17',), + "liboop4" : ('1.0',), + "libopenal0" : ('1.13',), + "libpgeasy3" : ('3.0.4',), + "libportaudio2" : ('19',), + "libqnotify0" : ('0.6',), + "libqtc1" : ('0.7a',), + "libqtsharp0" : ('0.7.1',), + "libquadmath0" : ('4.4.2_20100116', '4.5.3_20110428','4.6.1_20110926'), + "librdf0" : ('0.4.0',), + "librsync1" : ('0.9.7',), + "libsamplerate0" : ('0.1.7',), + "libsecprog0" : ('0.8',), + "libsexy2" : ('0.1.11',), + "libsigc-1_2-5" : ('2.2.10',), + "libsndfile1" : ('1.0.20', '1.0.25'), + "libstdc++6" : ('4.4.2_20100116', '4.5.3_20110428', '4.6.1_20110926'), + "libstroke0" : ('0.5.1',), + "libthai0" : ('0.1.15',), + "libutempter0" : ('0.5.5',), + "libvisual-0_4-0" : ('0.4.0',), + "libxclass0_9_2" : ('0.9.2',), + "libxfcegui4-4" : ('4.8.1',), + "libxfce4util4" : ('4.8.1',), + "libxflaim3_2" : ('5.1.1046',), + "libxkbfile1" : ('7.6',), + "libxml2-2" : ('2.7.8+git20110708',), + "libz1" : ('1.2.3','1.2.5','1.2.5_git201105272030'), + "libzio0" : ('0.99',) +} + _essential_dependencies = ( "ld-linux.so.2", "libacl.so.1", @@ -300,6 +317,7 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck): def check(self, pkg): global _policy_legacy_exceptions + global _policy_every_version_exceptions if pkg.isSource(): return @@ -382,8 +400,17 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck): libname = libname_from_soname (soname) if libname.startswith('lib') and pkg.name != libname and \ pkg.name != libname + "-mini": + matchesExceptionList = False + if libname in _policy_every_version_exceptions: + matchesExceptionList = True if libname in _policy_legacy_exceptions: - printWarning(pkg, 'shlib-legacy-policy-name-error', libname) + for ver in _policy_legacy_exceptions[libname]: + if pkg[rpm.RPMTAG_VERSION] == ver: + matchesExceptionList = True + break + if matchesExceptionList: + printWarning(pkg, 'shlib-legacy-policy-name-error', + libname) else: printError(pkg, 'shlib-policy-name-error', libname) @@ -394,7 +421,7 @@ class LibraryPolicyCheck(AbstractCheck.AbstractCheck): return if not libs: - if pkg.name in _policy_legacy_exceptions: + if pkg.name in _policy_legacy_exceptions.keys(): printWarning(pkg, 'shlib-legacy-policy-missing-lib', pkg.name) else: printError(pkg, 'shlib-policy-missing-lib') diff --git a/rpmlint.changes b/rpmlint.changes index 4ef98f5..17cf2d8 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 5 15:57:28 CET 2011 - dmueller@suse.de + +- fix invalid-suse-version-chec (bnc#732671) + ------------------------------------------------------------------- Tue Nov 29 12:39:47 UTC 2011 - lnussel@suse.de diff --git a/suse-version.diff b/suse-version.diff index 48da96e..e762ef4 100644 --- a/suse-version.diff +++ b/suse-version.diff @@ -17,7 +17,7 @@ Index: SpecCheck.py + res = suse_version_regex.search(line) + if res and int(res.group(1)) > 0 and int(res.group(1)) < 1130: + printWarning(pkg, "obsolete-suse-version-check", res.group(1)) -+ elif res and int(res.group(1)) > 1140: ++ elif res and int(res.group(1)) > 1230: + printError(pkg, "invalid-suse-version-check", res.group(1)) + res = prereq_regex.search(line)