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
This commit is contained in:
OBS User autobuild 2010-04-01 14:20:38 +00:00 committed by Git OBS Bridge
parent 7ace52c994
commit 698597df8c
19 changed files with 138 additions and 129 deletions

View File

@ -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():

View File

@ -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)

View File

@ -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())

View File

@ -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.''',

View File

@ -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)

View File

@ -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)

View File

@ -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:

View File

@ -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()

View File

@ -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),

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6acfd50bae5302d321a2b41c139d3cc39376ad5d81a3aa8a8ccfb0dd633cda2b
size 95746

3
rpmlint-0.95.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b8fdc18e6b98768197b5b9adee1316fa65073ed0372d47191f33636e93dde27
size 100631

View File

@ -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

View File

@ -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} .

View File

@ -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 \

View File

@ -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)-'))

View File

@ -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.''',

View File

@ -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/'):

View File

@ -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

View File

@ -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()]