From fad8761a2b4db60c40c5fcf4d3aa6cd2c97dee94ab4d03ff56becfdc1b174e19 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 26 Apr 2011 13:26:38 +0000 Subject: [PATCH 1/5] - make error description more clearn (bnc#686328) OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=5 --- rpmlint.changes | 5 +++++ rpmlint.spec | 2 ++ suse-speccheck-utf8.diff | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 suse-speccheck-utf8.diff diff --git a/rpmlint.changes b/rpmlint.changes index a6c3043..5bb4b2b 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 26 15:19:36 CEST 2011 - dmueller@suse.de + +- make error description more clearn (bnc#686328) + ------------------------------------------------------------------- Sat Apr 23 11:11:37 CEST 2011 - dmueller@suse.de diff --git a/rpmlint.spec b/rpmlint.spec index b3acf3a..315f348 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -122,6 +122,7 @@ Patch85: suse-changelog.patch Patch86: suse-rclink-check.diff # already upstream Patch87: rpmlint-add-details.diff +Patch88: suse-speccheck-utf8.diff %py_requires %description @@ -199,6 +200,7 @@ Authors: %patch85 %patch86 %patch87 -p1 +%patch88 cp -p %{SOURCE1} . cp -p %{SOURCE2} . cp -p %{SOURCE3} . diff --git a/suse-speccheck-utf8.diff b/suse-speccheck-utf8.diff new file mode 100644 index 0000000..bf2e5cc --- /dev/null +++ b/suse-speccheck-utf8.diff @@ -0,0 +1,13 @@ +--- SpecCheck.py ++++ SpecCheck.py +@@ -597,8 +597,8 @@ + ("Name:" tag). Either rename your package or the specfile.''', + + 'non-utf8-spec-file', +-'''The character encoding of the spec file is not UTF-8. Convert it for +-example using iconv(1).''', ++'''The character encoding of the spec file (or the merged bits from the .changes file) ++is not UTF-8. Convert it for example using iconv(1).''', + + 'use-of-RPM_SOURCE_DIR', + '''You use $RPM_SOURCE_DIR or %{_sourcedir} in your spec file. If you have to From bcd393883652dceb28674fd16cc0439244409a4374a42070525573abf297218d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 27 Apr 2011 13:22:17 +0000 Subject: [PATCH 2/5] merge conflict OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=7 --- noarch-lib64.diff | 48 +++++++++++++++----------------- rpmlint.changes | 6 ++++ rpmlint.spec | 6 ++-- suse-filter-exception.diff | 57 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 28 deletions(-) create mode 100644 suse-filter-exception.diff diff --git a/noarch-lib64.diff b/noarch-lib64.diff index 4175726..f8717b2 100644 --- a/noarch-lib64.diff +++ b/noarch-lib64.diff @@ -1,43 +1,39 @@ --- BinariesCheck.py +++ BinariesCheck.py -@@ -153,6 +153,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck): - binary=0 - binary_in_usr_lib=0 - has_usr_lib_file=0 -+ file_in_lib64=0 +@@ -223,6 +223,7 @@ + binary = False + binary_in_usr_lib = False + has_usr_lib_file = False ++ file_in_lib64 = False + multi_pkg = False res = srcname_regex.search(pkg[rpm.RPMTAG_SOURCERPM] or '') - if res: -@@ -161,10 +162,13 @@ class BinariesCheck(AbstractCheck.AbstractCheck): - multi_pkg=0 +@@ -239,6 +240,10 @@ + # only-non-binary-in-usr-lib false positives + binary_in_usr_lib = True - for f in files: -- if usr_lib_regex.search(f) and not usr_lib_exception_regex.search(f) and not stat.S_ISDIR(files[f][0]): -+ if stat.S_ISREG(files[f][0]) and usr_lib_regex.search(f) and not usr_lib_exception_regex.search(f): - has_usr_lib_file=f - break - -+ if stat.S_ISREG(files[f][0]) and (f.startswith("/usr/lib64") or f.startswith("/lib64")): -+ file_in_lib64=1 ++ if stat.S_ISREG(pkgfile.mode) and \ ++ (fname.startswith("/usr/lib64") or fname.startswith("/lib64")): ++ file_in_lib64 = True + - for i in info: - is_elf = string.find(i[1], 'ELF') != -1 - is_ar = string.find(i[1], 'current ar archive') != -1 -@@ -316,9 +320,12 @@ class BinariesCheck(AbstractCheck.AbstractCheck): + is_elf = 'ELF' in pkgfile.magic + is_ar = 'current ar archive' in pkgfile.magic + is_ocaml_native = 'Objective caml native' in pkgfile.magic +@@ -433,9 +438,12 @@ + if version and version != -1 and version not in pkg.name: printError(pkg, 'incoherent-version-in-name', version) - if pkg.arch != 'noarch' and not multi_pkg: -- if binary == 0: -+ if binary == 0 and not file_in_lib64: - printError(pkg, 'no-binary') +- if not binary and not multi_pkg and pkg.arch != 'noarch': ++ if not binary and not multi_pkg and not file_in_lib64 and pkg.arch != 'noarch': + printError(pkg, 'no-binary') + if pkg.arch == 'noarch' and file_in_lib64: + printError(pkg, 'noarch-with-lib64') + if has_usr_lib_file and not binary_in_usr_lib: - printError(pkg, 'only-non-binary-in-usr-lib') + printWarning(pkg, 'only-non-binary-in-usr-lib') -@@ -343,6 +350,11 @@ FHS and the FSSTND forbid this.''', +@@ -459,6 +467,11 @@ # 'non-sparc32-binary', # '', diff --git a/rpmlint.changes b/rpmlint.changes index 5bb4b2b..9f97dbe 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 27 15:09:54 CEST 2011 - dmueller@suse.de + +- implement setFilterException() +- rediff noarch-lib64.diff and enable it again (bnc#663885) + ------------------------------------------------------------------- Tue Apr 26 15:19:36 CEST 2011 - dmueller@suse.de diff --git a/rpmlint.spec b/rpmlint.spec index 315f348..f2377d5 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -23,7 +23,7 @@ Name: rpmlint BuildRequires: rpm-python Summary: Rpm correctness checker Version: 1.1 -Release: 27 +Release: 29 Source0: %{name}-%{version}.tar.bz2 Source1: config Source1001: config.in @@ -74,6 +74,7 @@ Patch11: suse-file-var-run.diff Patch12: usr-arch.diff Patch13: script-interpreter-only-for-exec-scripts.diff Patch14: sourced-dirs.diff +Patch15: suse-filter-exception.diff Patch17: docdata-examples.diff Patch19: yast-provides.diff Patch20: xdg-paths-update.diff @@ -153,6 +154,7 @@ Authors: %patch12 %patch13 %patch14 +%patch15 %patch17 %patch19 %patch20 @@ -172,7 +174,7 @@ Authors: #%patch41 %patch42 #%patch46 -#%patch47 +%patch47 #%patch49 %patch50 %patch51 diff --git a/suse-filter-exception.diff b/suse-filter-exception.diff new file mode 100644 index 0000000..d8ee999 --- /dev/null +++ b/suse-filter-exception.diff @@ -0,0 +1,57 @@ +--- Config.py ++++ Config.py +@@ -115,6 +115,8 @@ + # List of filters + _filters = [] + _filters_re = None ++_filters_except = [] ++_filters_except_re = None + + def addFilter(s): + global _filters +@@ -137,8 +139,14 @@ + _scoring = {} + + def setBadness(s, score): ++ global _scoring + _scoring[s] = score + ++def setFilterException(s): ++ global _filters_except ++ ++ _filters_except.append(s) ++ + def badness(s): + return _scoring.get(s, 0) + +@@ -146,6 +154,8 @@ + def isFiltered(s): + global _filters + global _filters_re ++ global _filters_except ++ global _filters_except_re + + if _filters_re == None: + # no filter +@@ -162,7 +172,21 @@ + _filters_re = _filters_re + '|(?:' + _filters[idx] +')' + _filters_re = re.compile(_filters_re) + ++ if _filters_except_re == None and len(_filters_except): ++ _filters_except_re = '(?:' + _filters_except[0] + ')' ++ ++ for idx in range(1, len(_filters_except)): ++ # to prevent named group overflow that happen when there is too ++ # many () in a single regexp: AssertionError: sorry, but this ++ # version only supports 100 named groups ++ if '(' in _filters_except[idx]: ++ _non_named_group_re.subn('(:?', _filters_except[idx]) ++ _filters_except_re = _filters_except_re + '|(?:' + _filters_except[idx] +')' ++ _filters_except_re = re.compile(_filters_except_re) ++ + if not no_exception: ++ if _filters_except_re and _filters_except_re.search(s): ++ return False + if _filters_re.search(s): + return True + return False From d225b9bb621bd677098a62c0a02c87e4f5fe14ec0b387f66af812d0f0c7fa495 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Mon, 2 May 2011 11:56:54 +0000 Subject: [PATCH 3/5] - another try to fix InitScriptCheck.py OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=8 --- rpmlint.changes | 5 ++++ suse-rclink-check.diff | 21 ++++++++------ sysv5-init-checks.diff | 66 ++++++++++++------------------------------ 3 files changed, 36 insertions(+), 56 deletions(-) diff --git a/rpmlint.changes b/rpmlint.changes index 9f97dbe..6782e5d 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 2 11:56:25 UTC 2011 - lnussel@suse.de + +- another try to fix InitScriptCheck.py + ------------------------------------------------------------------- Wed Apr 27 15:09:54 CEST 2011 - dmueller@suse.de diff --git a/suse-rclink-check.diff b/suse-rclink-check.diff index 201ac37..a705bb4 100644 --- a/suse-rclink-check.diff +++ b/suse-rclink-check.diff @@ -1,6 +1,8 @@ ---- InitScriptCheck.py +Index: InitScriptCheck.py +=================================================================== +--- InitScriptCheck.py.orig +++ InitScriptCheck.py -@@ -51,7 +51,7 @@ +@@ -50,7 +50,7 @@ class InitScriptCheck(AbstractCheck.Abst return initscript_list = [] @@ -9,17 +11,18 @@ # check chkconfig call in %post and %preun postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG] -@@ -60,6 +60,9 @@ +@@ -59,6 +59,10 @@ class InitScriptCheck(AbstractCheck.Abst for fname, pkgfile in pkg.files().items(): -+ if stat.S_ISLNK(pkgfile.mode) and fname.startswith("/usr/sbin/rc"): ++ if stat.S_ISLNK(pkgfile.mode) and (fname.startswith("/usr/sbin/rc") \ ++ or fname.startswith("/sbin/rc")): + rclinks.add(fname.partition('/rc')[2]) + if not fname.startswith('/etc/init.d/') and \ not fname.startswith('/etc/rc.d/init.d/'): continue -@@ -199,6 +202,12 @@ +@@ -194,6 +198,12 @@ class InitScriptCheck(AbstractCheck.Abst if not subsys_regex_found: printError(pkg, 'subsys-not-used', fname) @@ -32,13 +35,13 @@ goodnames = (pkg.name.lower(), pkg.name.lower() + 'd') if len(initscript_list) == 1 and initscript_list[0] not in goodnames: printWarning(pkg, 'incoherent-init-script-name', initscript_list[0], -@@ -229,6 +238,10 @@ - '''The package contains an init script but doesn't contain a %postun - with a call to %insserv_cleanup-postun''', +@@ -216,6 +226,10 @@ a call to chkconfig.''', + '''The package contains an init script but doesn't contain a %preun with + a call to chkconfig.''', +'suse-missing-rclink', +'''The package contains an init script with the given name but does not -+have contain the SUSE policy symlink /usr/sbin/rcFOO -> /etc/init.d/FOO''', ++contain the SUSE policy symlink /usr/sbin/rcFOO -> /etc/init.d/FOO''', + 'preun-without-chkconfig', '''The package contains an init script but doesn't call chkconfig in its diff --git a/sysv5-init-checks.diff b/sysv5-init-checks.diff index ec159a1..91ec130 100644 --- a/sysv5-init-checks.diff +++ b/sysv5-init-checks.diff @@ -1,17 +1,18 @@ ---- InitScriptCheck.py +Index: InitScriptCheck.py +=================================================================== +--- InitScriptCheck.py.orig +++ InitScriptCheck.py -@@ -29,6 +29,10 @@ +@@ -29,6 +29,9 @@ dot_in_name_regex = re.compile('.*\..*') use_deflevels = Config.getOption('UseDefaultRunlevels', True) lsb_tags_regex = re.compile('^# ([\w-]+):\s*(.*?)\s*$') lsb_cont_regex = re.compile('^#(?:\t| )(.*?)\s*$') -+insserv_regex=re.compile('^\s*sbin/insserv', re.MULTILINE) -+stop_on_removal_regex=re.compile('^\s*%stop_on_removal\s+\S+', re.MULTILINE) -+restart_on_update_regex=re.compile('^\s*%restart_on_update\s\S+', re.MULTILINE) -+insserv_cleanup_regex=re.compile('^\s*%insserv_cleanup', re.MULTILINE) ++stop_on_removal_regex=re.compile('/etc/init.d/\$service stop > /dev/null') ++restart_on_update_regex=re.compile('/etc/init.d/\$service try-restart > /dev/null') ++insserv_cleanup_regex=re.compile('^\s*/sbin/insserv /etc/init.d$', re.MULTILINE) LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start', 'Should-Stop', 'Default-Start', 'Default-Stop', -@@ -47,6 +51,13 @@ +@@ -47,6 +50,13 @@ class InitScriptCheck(AbstractCheck.Abst return initscript_list = [] @@ -25,7 +26,7 @@ for fname, pkgfile in pkg.files().items(): if not fname.startswith('/etc/init.d/') and \ -@@ -60,18 +71,19 @@ +@@ -60,18 +70,15 @@ class InitScriptCheck(AbstractCheck.Abst if dot_in_name_regex.match(basename): printError(pkg, 'init-script-name-with-dot', fname) @@ -35,47 +36,25 @@ - printError(pkg, 'init-script-without-chkconfig-postin', fname) - elif not chkconfig_regex.search(postin): - printError(pkg, 'postin-without-chkconfig', fname) - +- - preun = pkg[rpm.RPMTAG_PREUN] or pkg[rpm.RPMTAG_PREUNPROG] - if not preun: +- if not preun: - printError(pkg, 'init-script-without-chkconfig-preun', fname) - elif not chkconfig_regex.search(preun): - printError(pkg, 'preun-without-chkconfig', fname) -+ printError(pkg, 'init-script-without-%stop_on_removal-preun', fname) -+ elif not stop_on_removal_regex.search(preun): -+ printError(pkg, 'preun-without-%stop_on_removal-preun', fname) + -+ if not postun: ++ if not preun or not stop_on_removal_regex.search(preun): ++ printError(pkg, 'init-script-without-%stop_on_removal-preun', fname) ++ ++ if not postun or not restart_on_update_regex.search(postun): + printError(pkg, 'init-script-without-%restart_on_update-postun', fname) -+ else: -+ if not restart_on_update_regex.search(postun): -+ printError(pkg, 'postun-without-%restart_on_update', fname) -+ if not insserv_cleanup_regex.search(postun): -+ printError(pkg, 'postun-without-%insserv_cleanup', fname) ++ ++ if not postun or not insserv_cleanup_regex.search(postun): ++ printError(pkg, 'init-script-without-%insserv_cleanup-postun', fname) status_found = False reload_found = False -@@ -202,10 +214,18 @@ - '''The package contains an init script but doesn't call chkconfig in its - %post script.''', - --'init-script-without-chkconfig-preun', -+'init-script-without-%stop_on_removal-preun', - '''The package contains an init script but doesn't contain a %preun with - a call to chkconfig.''', - -+'init-script-without-%insserv_cleanup-postun', -+'''The package contains an init script but doesn't contain a %postun -+with a call to %insserv_cleanup-postun''', -+ -+'postun-without-%insserv_cleanup', -+'''The package contains an init script but doesn't contain a %postun -+with a call to %insserv_cleanup-postun''', -+ - 'preun-without-chkconfig', - '''The package contains an init script but doesn't call chkconfig in its - %preun script.''', -@@ -264,6 +284,24 @@ +@@ -264,6 +271,17 @@ of chkconfig don't work as expected with 'init-script-non-executable', '''The init script should have at least the execution bit set for root in order for it to run at boot time.''', @@ -83,16 +62,9 @@ +'init-script-without-%stop_on_removal-preun', +'''The init script should have a %preun script that calls %stop_on_removal.''', + -+'preun-without-%stop_on_removal-preun', -+'''The init script is not listed in %stop_on_removal in %preun.''', -+ +'init-script-without-%insserv_cleanup-postun', +'''The package doesn't have a %insserv_cleanup call in %postun''', + -+'postun-without-%insserv_cleanup', -+'''The package has an init script that is inserted with insserv but -+doesn't have a %insserv_cleanup call in %postun''', -+ +'init-script-without-%restart_on_update-postun', +''' The package has an init script but is missing the %restart_on_update +call in %postun to automatically restart the daemon. This is optional, From da11f653fcbbc504aeafa70f84ad797c6b829769fe44e02a24b24a209976682c Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Mon, 2 May 2011 12:21:03 +0000 Subject: [PATCH 4/5] add bug number to changelog OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=9 --- rpmlint.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpmlint.changes b/rpmlint.changes index 6782e5d..3e837c7 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Mon May 2 11:56:25 UTC 2011 - lnussel@suse.de -- another try to fix InitScriptCheck.py +- another try to fix InitScriptCheck.py (bnc#690961) ------------------------------------------------------------------- Wed Apr 27 15:09:54 CEST 2011 - dmueller@suse.de From d612f262271875ab3605d4cc1e034070b796f559dd5634071ac86f4a21b7cfbd Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Mon, 2 May 2011 14:17:13 +0000 Subject: [PATCH 5/5] - add account services (bnc#676638) OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=10 --- config | 3 +++ rpmlint.changes | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/config b/config index f9ec1f1..4333ff2 100644 --- a/config +++ b/config @@ -414,6 +414,9 @@ setOption("DBUSServices.WhiteList", ( # urfkill (bnc#688328) "org.freedesktop.URfkill.service", "org.freedesktop.URfkill.conf", + # account services (bnc#676638) + "org.freedesktop.Accounts.service", + "org.freedesktop.Accounts.conf", )) # Output filters diff --git a/rpmlint.changes b/rpmlint.changes index 3e837c7..46a6ce1 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon May 2 14:17:04 UTC 2011 - lnussel@suse.de + +- add account services (bnc#676638) + ------------------------------------------------------------------- Mon May 2 11:56:25 UTC 2011 - lnussel@suse.de