From 698597df8cb98b65f9da661dfb19c51969b0845b6e6125b0210f88c7e4c6a581 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 1 Apr 2010 14:20:38 +0000 Subject: [PATCH] Accepting request 36612 from Base:System Copy from Base:System/rpmlint based on submit request 36612 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/36612 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=55 --- CheckBuildRoot.py | 5 +++- add-weak-dependencies.diff | 29 +++++++++---------- buildroot-in-scripts.diff | 12 ++++---- description-check.diff | 18 ++++++------ detailed-desktop-file-check.diff | 17 ----------- fix-pyc-install.diff | 11 ------- libtool-wrapper-check.diff | 28 +++++++++++++----- no-badness-return.diff | 24 +++++++-------- rpmgroup-checks.diff | 27 +++++++++++------ rpmlint-0.92.tar.bz2 | 3 -- rpmlint-0.95.tar.bz2 | 3 ++ rpmlint.changes | 26 +++++++++++++++++ rpmlint.spec | 13 ++++----- script-interpreter-only-for-exec-scripts.diff | 12 ++++---- sourced-dirs.diff | 8 ++--- suse-no-run-ldconfig.diff | 8 ++--- usr-arch.diff | 4 +-- xdg-paths-update.diff | 13 ++++----- yast-provides.diff | 6 ++-- 19 files changed, 138 insertions(+), 129 deletions(-) delete mode 100644 detailed-desktop-file-check.diff delete mode 100644 fix-pyc-install.diff delete mode 100644 rpmlint-0.92.tar.bz2 create mode 100644 rpmlint-0.95.tar.bz2 diff --git a/CheckBuildRoot.py b/CheckBuildRoot.py index 0078832..c920c3f 100644 --- a/CheckBuildRoot.py +++ b/CheckBuildRoot.py @@ -18,7 +18,10 @@ import stat class BuildRootCheck(AbstractCheck.AbstractFilesCheck): def __init__(self): AbstractCheck.AbstractFilesCheck.__init__(self, "CheckBuildRoot", ".*") - self.build_root_re = re.compile('/var/tmp/[\w\!-\.]{1,60}-build/') + t = rpm.expandMacro('%buildroot') + for m in ('name', 'version', 'release'): + t = t.replace("%%{%s}" % (m), "[\w\!-\.]{1,20}") + self.build_root_re = re.compile(t) def check_file(self, pkg, filename): if filename.startswith('/usr/lib/debug') or pkg.isSource(): diff --git a/add-weak-dependencies.diff b/add-weak-dependencies.diff index ae4f63a..03bcf95 100644 --- a/add-weak-dependencies.diff +++ b/add-weak-dependencies.diff @@ -1,8 +1,6 @@ -Index: Pkg.py -=================================================================== ---- Pkg.py.orig +--- Pkg.py +++ Pkg.py -@@ -307,6 +307,10 @@ class Pkg: +@@ -328,6 +328,10 @@ self._missingok_files = None self._files = None self._requires = None @@ -13,7 +11,7 @@ Index: Pkg.py self._req_names = -1 if header: -@@ -513,6 +517,22 @@ class Pkg: +@@ -553,6 +557,22 @@ self._gatherDepInfo() return self._requires @@ -36,30 +34,29 @@ Index: Pkg.py def prereq(self): self._gatherDepInfo() return self._prereq -@@ -542,7 +562,8 @@ class Pkg: - return self._provides +@@ -586,7 +606,7 @@ # internal function to gather dependency info used by the above ones -- def _gather_aux(self, header, list, nametag, versiontag, flagstag, prereq = None): -+ def _gather_aux(self, header, list, nametag, versiontag, flagstag, -+ prereq = None, strong_only = False, weak_only = False): + def _gather_aux(self, header, list, nametag, versiontag, flagstag, +- prereq = None): ++ prereq = None, strong_only = False, weak_only = False): names = header[nametag] versions = header[versiontag] flags = header[flagstag] -@@ -551,7 +572,11 @@ class Pkg: - for loop in range(len(versions)): +@@ -596,7 +616,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], versions[loop], + flags[loop] & (~PREREQ_FLAG))) - 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): ++ 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])) def _gatherDepInfo(self): -@@ -561,6 +586,10 @@ class Pkg: +@@ -606,6 +630,10 @@ self._provides = [] self._conflicts = [] self._obsoletes = [] @@ -70,7 +67,7 @@ Index: Pkg.py self._gather_aux(self.header, self._requires, rpm.RPMTAG_REQUIRENAME, -@@ -579,6 +608,27 @@ class Pkg: +@@ -624,6 +652,27 @@ rpm.RPMTAG_OBSOLETENAME, rpm.RPMTAG_OBSOLETEVERSION, rpm.RPMTAG_OBSOLETEFLAGS) diff --git a/buildroot-in-scripts.diff b/buildroot-in-scripts.diff index 8ab576f..cd0a771 100644 --- a/buildroot-in-scripts.diff +++ b/buildroot-in-scripts.diff @@ -1,8 +1,6 @@ -Index: SpecCheck.py -=================================================================== ---- SpecCheck.py.orig +--- SpecCheck.py +++ SpecCheck.py -@@ -57,7 +57,10 @@ suse_version_regex = re.compile('%suse_v +@@ -59,7 +59,10 @@ section_regexs = dict( ([x, re.compile('^%' + x + '(?:\s|$)')] for x in ('build', 'changelog', 'check', 'clean', 'description', 'files', @@ -14,7 +12,7 @@ Index: SpecCheck.py # Only check for /lib, /usr/lib, /usr/X11R6/lib # TODO: better handling of X libraries and modules. -@@ -257,7 +260,9 @@ class SpecCheck(AbstractCheck.AbstractCh +@@ -264,7 +267,9 @@ continue @@ -23,5 +21,5 @@ Index: SpecCheck.py + 'trigger', 'triggerin', 'triggerprein', 'triggerun', 'triggerpostun', + 'pretrans', 'posttrans'): if contains_buildroot(line): - printWarning(pkg, 'rpm-buildroot-usage', '%' + current_section, line[:-1].strip()) - + printWarning(pkg, 'rpm-buildroot-usage', + '%' + current_section, line[:-1].strip()) diff --git a/description-check.diff b/description-check.diff index 306cbbd..0b4d60e 100644 --- a/description-check.diff +++ b/description-check.diff @@ -1,23 +1,23 @@ --- TagsCheck.py +++ TagsCheck.py -@@ -616,6 +616,9 @@ - if not pkg[rpm.RPMTAG_DESCRIPTION]: +@@ -660,6 +660,9 @@ + if not description: printError(pkg, 'no-description-tag') else: + if len(pkg[rpm.RPMTAG_DESCRIPTION].partition('Authors:')[0])-4 < len(pkg[rpm.RPMTAG_SUMMARY]): + printWarning(pkg, 'description-shorter-than-summary') + - for lang in pkg[rpm.RPMTAG_HEADERI18NTABLE]: - self.check_description(pkg, lang) - res = AbstractCheck.macro_regex.search(pkg[rpm.RPMTAG_DESCRIPTION]) -@@ -881,6 +884,10 @@ + if not pkg[rpm.RPMTAG_HEADERI18NTABLE]: + self._unexpanded_macros(pkg, '%description', description) + else: +@@ -928,6 +931,10 @@ '''The major number of the library isn't included in the package's name. ''', +'description-shorter-than-summary', -+'''The package description is shorter than the summary. be a bit more ++'''The package description should be longer than the summary. be a bit more +verbose, please.''', + 'no-provides', - '''Your library package doesn't provide the -devel name without the major version - included.''', + '''Your library package doesn't provide the -devel name without the major + version included.''', diff --git a/detailed-desktop-file-check.diff b/detailed-desktop-file-check.diff deleted file mode 100644 index 450e518..0000000 --- a/detailed-desktop-file-check.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- MenuXDGCheck.py -+++ MenuXDGCheck.py -@@ -21,8 +21,12 @@ - - def check_file(self, pkg, filename): - f = pkg.dirName() + filename -- if getstatusoutput(('desktop-file-validate', f), True)[0]: -- printError(pkg, 'invalid-desktopfile', filename) -+ st = getstatusoutput(('desktop-file-validate', f), True) -+ if st[0]: -+ if st[1].find('error:') != -1: -+ printError(pkg, 'invalid-desktopfile', filename, st[1].split('error: ')[1]) -+ else: -+ printError(pkg, 'invalid-desktopfile', filename) - if not is_utf8(f): - printError(pkg, 'non-utf8-desktopfile', filename) - diff --git a/fix-pyc-install.diff b/fix-pyc-install.diff deleted file mode 100644 index 54fdfd9..0000000 --- a/fix-pyc-install.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile -+++ Makefile -@@ -40,7 +40,7 @@ - - install: - -mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(ETCDIR)/$(PACKAGE) $(DESTDIR)$(ETCDIR)/bash_completion.d $(DESTDIR)$(MANDIR)/man1 -- cp -p *.py *.pyc *.pyo $(DESTDIR)$(LIBDIR) -+ cp -p *.py *.py[co] $(DESTDIR)$(LIBDIR) - sed -e 's/@VERSION@/$(VERSION)/' < rpmlint.py > $(DESTDIR)$(LIBDIR)/rpmlint.py - cp -p rpmlint rpmdiff $(DESTDIR)$(BINDIR) - cp -p config $(DESTDIR)$(ETCDIR)/$(PACKAGE) diff --git a/libtool-wrapper-check.diff b/libtool-wrapper-check.diff index 548d108..7e3ca3a 100644 --- a/libtool-wrapper-check.diff +++ b/libtool-wrapper-check.diff @@ -1,10 +1,24 @@ ---- BinariesCheck.py -+++ BinariesCheck.py -@@ -165,6 +165,7 @@ - is_elf = string.find(i[1], 'ELF') != -1 - is_ar = string.find(i[1], 'current ar archive') != -1 - is_ocaml_native = string.find(i[1], 'Objective caml native') != -1 -+ is_shell = string.find(i[1], "shell script") != -1 +package ProtocolReader; + i + +require Exportei path +Da/work/built/patchinfo/a8074a35e4528cffdfb08bd7c9969012/protocol-autotest"))Da/work/built/patchinfo/a8074a35e4528cffdfb08bd7c9969012/protocol-autotest"));; +@ISA = qw(Exporter); +@EXPORT = qw(new read); + is_ar = + +rpath + +asdfdff + +ead_one_protocol("fc46dcae41fa022273d4dfd752880372/protocol") to + +:x + +sub new { bless {} } string.find(i[1], 'current ar archive') != -1 + is_ocaml_native = string.find(i[1], 'ObjABXML::ABXML::patchprotocolnative') != -1 +print Dumper(a+ is_shell = string.find(i[1], "shell script") != -)1 + is_binary = is_elf or is_ar or is_ocaml_native if is_binary: diff --git a/no-badness-return.diff b/no-badness-return.diff index 0f46c01..f443106 100644 --- a/no-badness-return.diff +++ b/no-badness-return.diff @@ -1,6 +1,17 @@ +--- Filter.py ++++ Filter.py +@@ -104,7 +104,7 @@ + if len(last_reason): + printDescriptions(last_reason) + last_reason = reason +- __print(diag) ++ __print(diag[:-1]) + if Config.info and len(last_reason): + printDescriptions(last_reason) + _diagnostic = list() --- rpmlint.py +++ rpmlint.py -@@ -190,7 +190,7 @@ +@@ -201,7 +201,7 @@ % (packages_checked, specfiles_checked, printed_messages["E"], printed_messages["W"]) @@ -9,14 +20,3 @@ sys.exit(64) sys.exit(0) ---- Filter.py -+++ Filter.py -@@ -96,7 +96,7 @@ - if len(last_reason): - printDescriptions(last_reason) - last_reason = reason -- Pkg.rlprint(diag) -+ Pkg.rlprint(diag[:-1]) - if Config.info and len(last_reason): - printDescriptions(last_reason) - _diagnostic = list() diff --git a/rpmgroup-checks.diff b/rpmgroup-checks.diff index 65843fd..64727ae 100644 --- a/rpmgroup-checks.diff +++ b/rpmgroup-checks.diff @@ -1,13 +1,22 @@ --- TagsCheck.py +++ TagsCheck.py -@@ -626,7 +626,9 @@ +@@ -653,6 +653,8 @@ + self._unexpanded_macros(pkg, 'Group', group) if not group: printError(pkg, 'no-group-tag') - else: -- if VALID_GROUPS and group not in VALID_GROUPS: -+ if pkg.name.find('-devel') != -1 and not group.startswith('Development/'): -+ printWarning(pkg, 'devel-package-with-non-devel-group', group) -+ elif VALID_GROUPS and group not in VALID_GROUPS: - printWarning(pkg, 'non-standard-group', group) - else: - res = AbstractCheck.macro_regex.search(group) ++ elif pkg.name.find('-devel') != -1 and not group.startswith('Development/'): ++ printWarning(pkg, 'devel-package-with-non-devel-group', group) + elif VALID_GROUPS and group not in VALID_GROUPS: + printWarning(pkg, 'non-standard-group', group) + +@@ -949,6 +951,10 @@ + '''There is no Group tag in your package. You have to specify a valid group + in your spec file using the Group tag.''', + ++'devel-package-with-non-devel-group', ++'''The package ends with -devel but does not have a RPM group starting with ++Development/''', ++ + 'non-standard-group', + '''The value of the Group tag in the package is not valid. Valid groups are: + "%s".''' % '", "'.join(VALID_GROUPS), diff --git a/rpmlint-0.92.tar.bz2 b/rpmlint-0.92.tar.bz2 deleted file mode 100644 index f5fbd17..0000000 --- a/rpmlint-0.92.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6acfd50bae5302d321a2b41c139d3cc39376ad5d81a3aa8a8ccfb0dd633cda2b -size 95746 diff --git a/rpmlint-0.95.tar.bz2 b/rpmlint-0.95.tar.bz2 new file mode 100644 index 0000000..1f99c61 --- /dev/null +++ b/rpmlint-0.95.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b8fdc18e6b98768197b5b9adee1316fa65073ed0372d47191f33636e93dde27 +size 100631 diff --git a/rpmlint.changes b/rpmlint.changes index 439abc1..15c10b8 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Thu Mar 25 22:45:09 CET 2010 - dmueller@suse.de + +- fix buildroot detection (bnc#584952) + +------------------------------------------------------------------- +Fri Mar 19 15:39:57 CET 2010 - dmueller@suse.de + +- update to 0.95: + * Skip ghost files in files checks, https://bugzilla.redhat.com/570086 + * Work around Python's ASCII non-TTY stdout and our non-ASCII output. + * Omit spell check warnings for capitalized words that do not start a sentence. + * Wrap bunch of long lines, tune comments and info messages. + * Require rpm-python >= 4.4.2.2 for expandMacro() in r1729. + * do not execute check if the network test are marked as disabled, and simplify the logic + * do not expand the format of the filename format, (patch from Per Oyvind Karlsten ) + +------------------------------------------------------------------- +Sat Feb 27 12:00:20 CET 2010 - dmueller@suse.de + +- update to 0.94: + - rpm 4.8.0 support + - better python bytecode checks + - improved LSB/taglist + - various fixes/patches upstreamed + ------------------------------------------------------------------- Thu Feb 25 14:20:42 UTC 2010 - lnussel@suse.de diff --git a/rpmlint.spec b/rpmlint.spec index 3f69bfe..5c174f8 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -1,5 +1,5 @@ # -# spec file for package rpmlint (Version 0.92) +# spec file for package rpmlint (Version 0.95) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,8 +22,8 @@ Name: rpmlint BuildRequires: rpm-python Summary: Rpm correctness checker -Version: 0.92 -Release: 4 +Version: 0.95 +Release: 1 Source0: %{name}-%{version}.tar.bz2 Source1: config Source1001: config.in @@ -79,7 +79,6 @@ Patch23: buildroot-doc.diff # bogus, fails with aaa_base. disabled Patch24: sysv5-init-checks.diff Patch26: ignore-non-readable-in-etc.diff -Patch27: detailed-desktop-file-check.diff Patch29: rpmgroup-checks.diff Patch30: devel-provide-is-devel-package.diff # what's the reason behind that one? @@ -111,7 +110,6 @@ Patch69: useless-requires-doc.diff Patch71: suse-binary-info-compile-opts.diff Patch72: version-control-internal-file.diff Patch73: avoid-mismatched-libregex.diff -Patch74: fix-pyc-install.diff %py_requires %description @@ -131,7 +129,8 @@ Authors: %patch2 %patch3 %patch4 -%patch5 +# needs rediff +#%patch5 %patch6 %patch7 %patch8 @@ -151,7 +150,6 @@ Authors: # bogus, fails with aaa_base. disabled #patch24 #%patch26 -%patch27 %patch29 %patch30 #%patch31 @@ -182,7 +180,6 @@ Authors: #%patch71 %patch72 %patch73 -%patch74 cp -p %{SOURCE1} . cp -p %{SOURCE2} . cp -p %{SOURCE3} . diff --git a/script-interpreter-only-for-exec-scripts.diff b/script-interpreter-only-for-exec-scripts.diff index f95afe5..73c56d1 100644 --- a/script-interpreter-only-for-exec-scripts.diff +++ b/script-interpreter-only-for-exec-scripts.diff @@ -1,13 +1,11 @@ -Index: FilesCheck.py -=================================================================== ---- FilesCheck.py.orig +--- FilesCheck.py +++ FilesCheck.py -@@ -1162,7 +1162,7 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -818,7 +818,7 @@ interpreter = None if res: interpreter = res.group(1) - if not interpreter_regex.search(interpreter): + if mode & 0111 != 0 and not interpreter_regex.search(interpreter): - printError(pkg, 'wrong-script-interpreter', f, interpreter) - elif not nonexec_file and not (lib_path_regex.search(f) and f.endswith('.la')): - printError(pkg, 'script-without-shebang', f) + printError(pkg, 'wrong-script-interpreter', + f, interpreter) + elif not nonexec_file and not \ diff --git a/sourced-dirs.diff b/sourced-dirs.diff index 8f8eb74..3a99ae8 100644 --- a/sourced-dirs.diff +++ b/sourced-dirs.diff @@ -1,13 +1,11 @@ -Index: FilesCheck.py -=================================================================== ---- FilesCheck.py.orig +--- FilesCheck.py +++ FilesCheck.py -@@ -683,7 +683,7 @@ manifest_perl_regex = re.compile('^/usr/ +@@ -212,7 +212,7 @@ 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)))/') -sourced_script_regex = re.compile('^/etc/(bash_completion\.d|profile\.d)/') +sourced_script_regex = re.compile('^/etc/(bash_completion\.d|profile\.d|/sbin/conf.d)/') use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) - skipdocs_regex = re.compile(Config.getOption('SkipDocsRegexp', '\.(?:rtf|x?html?|ml[ily]?)$'), re.IGNORECASE) + skipdocs_regex = re.compile(Config.getOption('SkipDocsRegexp', '\.(?:rtf|x?html?|svg|ml[ily]?)$'), re.IGNORECASE) meta_package_regex = re.compile(Config.getOption('MetaPackageRegexp', '^(bundle|task)-')) diff --git a/suse-no-run-ldconfig.diff b/suse-no-run-ldconfig.diff index cac2cd8..13c3e91 100644 --- a/suse-no-run-ldconfig.diff +++ b/suse-no-run-ldconfig.diff @@ -1,6 +1,6 @@ --- SpecCheck.py +++ SpecCheck.py -@@ -407,6 +407,10 @@ +@@ -421,6 +421,10 @@ printWarning(pkg, 'comparison-operator-in-deptoken', conf) @@ -9,9 +9,9 @@ + printWarning(pkg, 'deprecated-use-of-%run_ldconfig') + if current_section == 'changelog': - res = AbstractCheck.macro_regex.search(line) - if res and len(res.group(1)) % 2: -@@ -627,6 +631,14 @@ + for match in AbstractCheck.macro_regex.findall(line): + res = re.match('%+', match) +@@ -684,6 +688,14 @@ '''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/usr-arch.diff b/usr-arch.diff index 3810bf2..b42c426 100644 --- a/usr-arch.diff +++ b/usr-arch.diff @@ -8,8 +8,8 @@ def dir_base(path): res = path_regex.search(path) -@@ -233,7 +234,7 @@ - printError(pkg, 'arch-independent-package-contains-binary-or-object', fname) +@@ -238,7 +239,7 @@ + fname) else: # in /usr/share ? - if fname.startswith('/usr/share/'): diff --git a/xdg-paths-update.diff b/xdg-paths-update.diff index 10e6c6c..b240c5a 100644 --- a/xdg-paths-update.diff +++ b/xdg-paths-update.diff @@ -1,14 +1,11 @@ -Index: MenuXDGCheck.py -=================================================================== ---- MenuXDGCheck.py.orig +--- MenuXDGCheck.py +++ MenuXDGCheck.py -@@ -17,7 +17,8 @@ class MenuXDGCheck(AbstractCheck.Abstrac - # desktop file need to be in $XDG_DATA_DIRS +@@ -18,7 +18,7 @@ # $ echo $XDG_DATA_DIRS/applications # /var/lib/menu-xdg:/usr/share -- AbstractCheck.AbstractFilesCheck.__init__(self, "MenuXDGCheck", "/usr/share/applications/.*\.desktop$") -+ AbstractCheck.AbstractFilesCheck.__init__(self, "MenuXDGCheck", -+ "(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$") + AbstractCheck.AbstractFilesCheck.__init__( +- self, "MenuXDGCheck", "/usr/share/applications/.*\.desktop$") ++ self, "MenuXDGCheck", "(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$") def check_file(self, pkg, filename): f = pkg.dirName() + filename diff --git a/yast-provides.diff b/yast-provides.diff index 63546c5..50cf3fc 100644 --- a/yast-provides.diff +++ b/yast-provides.diff @@ -1,7 +1,7 @@ ---- TagsCheck.py.orig +--- TagsCheck.py +++ TagsCheck.py -@@ -674,7 +674,7 @@ class TagsCheck(AbstractCheck.AbstractCh - printWarning(pkg, 'no-url-tag') +@@ -739,7 +739,7 @@ + printWarning(pkg, 'no-url-tag') obs_names = [x[0] for x in pkg.obsoletes()] - prov_names = [x[0] for x in pkg.provides()]