From 958e7f5a2fea2c4a2d9349e5a4bcdafa7ac7f6f39435a7bc0c57c80f4ad023d2 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Wed, 25 May 2011 07:45:40 +0000 Subject: [PATCH 1/2] Updating link to change in openSUSE:Factory/rpmlint revision 120.0 OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=0ded91ba7d7bb3e9783c0b2eb09fa4dd --- rpmlint.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpmlint.spec b/rpmlint.spec index 9eb4210..cd114b5 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -23,7 +23,7 @@ Name: rpmlint BuildRequires: rpm-python xz Summary: Rpm correctness checker Version: 1.2 -Release: 3 +Release: 5 Source0: http://rpmlint.zarb.org/download/rpmlint-%{version}.tar.xz Source1: config Source1001: config.in From 4264d7212b98e8bd5e804398d493aa457b580c9f2ff47ab6dec8f3edbd9ebbbc Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 31 May 2011 11:31:05 +0000 Subject: [PATCH 2/2] - add check for /var/lock/subsys usage OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=31 --- config | 1 + rpmlint-subsys.diff | 73 ++++++++++++++++++++++++++++++++++++++++++ rpmlint.changes | 5 +++ rpmlint.spec | 2 ++ suse-rclink-check.diff | 12 +++---- sysv5-init-checks.diff | 15 +++++---- 6 files changed, 95 insertions(+), 13 deletions(-) create mode 100644 rpmlint-subsys.diff diff --git a/config b/config index 1a891d6..9b785a6 100644 --- a/config +++ b/config @@ -64,6 +64,7 @@ setOption("UseUTF8", 1) #setOption("ValidGroups", ("Group1", "Group2")) #setOption("KernelModuleRPMsOK", 0) setOption("CompressExtension", None) +setOption('UseVarLockSubsys', False) setOption('StandardGroups', ( 'aegis', diff --git a/rpmlint-subsys.diff b/rpmlint-subsys.diff new file mode 100644 index 0000000..dccb344 --- /dev/null +++ b/rpmlint-subsys.diff @@ -0,0 +1,73 @@ +From 665a612a589e161509de4aeab1486f430cc99e03 Mon Sep 17 00:00:00 2001 +From: Ludwig Nussel +Date: Tue, 31 May 2011 13:21:27 +0200 +Subject: [PATCH] add option to disable /var/lock/subsys check + +openSUSE for example doesn't use /var/lock/subsys +--- + InitScriptCheck.py | 11 +++++++++-- + config | 4 ++++ + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/InitScriptCheck.py b/InitScriptCheck.py +index ba7952e..167385b 100644 +--- a/InitScriptCheck.py ++++ b/InitScriptCheck.py +@@ -29,6 +29,7 @@ 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*$') ++use_subsys = Config.getOption('UseVarLockSubsys', True) + + LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start', + 'Should-Stop', 'Default-Start', 'Default-Stop', +@@ -152,7 +153,7 @@ class InitScriptCheck(AbstractCheck.AbstractCheck): + if res: + subsys_regex_found = True + name = res.group(1) +- if name != basename: ++ if use_subsys and name != basename: + error = True + if name[0] == '$': + value = Pkg.substitute_shell_vars(name, content_str) +@@ -181,8 +182,10 @@ class InitScriptCheck(AbstractCheck.AbstractCheck): + printWarning(pkg, 'no-reload-entry', fname) + if not chkconfig_content_found: + printError(pkg, 'no-chkconfig-line', fname) +- if not subsys_regex_found: ++ if not subsys_regex_found and use_subsys: + printError(pkg, 'subsys-not-used', fname) ++ elif subsys_regex_found and not use_subsys: ++ printError(pkg, 'subsys-unsupported', fname) + + goodnames = (pkg.name.lower(), pkg.name.lower() + 'd') + if len(initscript_list) == 1 and initscript_list[0] not in goodnames: +@@ -238,6 +241,10 @@ reasons, most services should not be. Use "-" as the default runlevel in the + init script's "chkconfig:" line and/or remove the "Default-Start:" LSB keyword + to fix this if appropriate for this service.''', + ++'subsys-unsupported', ++'''The init script uses /var/lock/subsys which is not supported by ++this distribution.''', ++ + 'subsys-not-used', + '''While your daemon is running, you have to put a lock file in + /var/lock/subsys/. To see an example, look at this directory on your +diff --git a/config b/config +index 8ed05d4..5631260 100644 +--- a/config ++++ b/config +@@ -162,6 +162,10 @@ from Config import * + # Type: boolean, default: True + #setOption("UseVersionInChangelog", True) + ++# Whether init scripts must use /var/lock/subsys ++# Type: boolean, default: True ++#setOption("UseVarLockSubsys", True) ++ + # Architecture dependent paths in which packages are allowed to install files + # even if they are all non-binary. + # Type: regexp, default: see BinariesCheck +-- +1.7.3.4 + diff --git a/rpmlint.changes b/rpmlint.changes index 9c4335c..f390982 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 31 11:29:52 UTC 2011 - lnussel@suse.de + +- add check for /var/lock/subsys usage + ------------------------------------------------------------------- Tue May 24 14:20:48 UTC 2011 - lnussel@suse.de diff --git a/rpmlint.spec b/rpmlint.spec index cd114b5..1ddd021 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -130,6 +130,7 @@ Patch88: suse-speccheck-utf8.diff Patch89: rpmlint-pie.diff # accepted upstream Patch90: rpmlint-typo.diff +Patch91: rpmlint-subsys.diff %py_requires %description @@ -145,6 +146,7 @@ Authors: %prep %setup -q -n rpmlint-%{version} +%patch91 -p1 %patch0 %patch1 %patch2 diff --git a/suse-rclink-check.diff b/suse-rclink-check.diff index a705bb4..fa9205b 100644 --- a/suse-rclink-check.diff +++ b/suse-rclink-check.diff @@ -2,7 +2,7 @@ Index: InitScriptCheck.py =================================================================== --- InitScriptCheck.py.orig +++ InitScriptCheck.py -@@ -50,7 +50,7 @@ class InitScriptCheck(AbstractCheck.Abst +@@ -52,7 +52,7 @@ class InitScriptCheck(AbstractCheck.Abst return initscript_list = [] @@ -11,7 +11,7 @@ Index: InitScriptCheck.py # check chkconfig call in %post and %preun postin = pkg[rpm.RPMTAG_POSTIN] or pkg[rpm.RPMTAG_POSTINPROG] -@@ -59,6 +59,10 @@ class InitScriptCheck(AbstractCheck.Abst +@@ -61,6 +61,10 @@ class InitScriptCheck(AbstractCheck.Abst for fname, pkgfile in pkg.files().items(): @@ -22,9 +22,9 @@ Index: InitScriptCheck.py if not fname.startswith('/etc/init.d/') and \ not fname.startswith('/etc/rc.d/init.d/'): continue -@@ -194,6 +198,12 @@ class InitScriptCheck(AbstractCheck.Abst - if not subsys_regex_found: - printError(pkg, 'subsys-not-used', fname) +@@ -198,6 +202,12 @@ class InitScriptCheck(AbstractCheck.Abst + elif subsys_regex_found and not use_subsys: + printError(pkg, 'subsys-unsupported', fname) + for script in initscript_list: + if script.startswith("rc") or script.startswith("boot."): @@ -35,7 +35,7 @@ Index: InitScriptCheck.py 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], -@@ -216,6 +226,10 @@ a call to chkconfig.''', +@@ -220,6 +230,10 @@ a call to chkconfig.''', '''The package contains an init script but doesn't contain a %preun with a call to chkconfig.''', diff --git a/sysv5-init-checks.diff b/sysv5-init-checks.diff index 91ec130..7914468 100644 --- a/sysv5-init-checks.diff +++ b/sysv5-init-checks.diff @@ -2,17 +2,18 @@ Index: InitScriptCheck.py =================================================================== --- InitScriptCheck.py.orig +++ InitScriptCheck.py -@@ -29,6 +29,9 @@ dot_in_name_regex = re.compile('.*\..*') - use_deflevels = Config.getOption('UseDefaultRunlevels', True) - lsb_tags_regex = re.compile('^# ([\w-]+):\s*(.*?)\s*$') +@@ -31,6 +31,10 @@ lsb_tags_regex = re.compile('^# ([\w-]+) lsb_cont_regex = re.compile('^#(?:\t| )(.*?)\s*$') + use_subsys = Config.getOption('UseVarLockSubsys', True) + +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 +50,13 @@ class InitScriptCheck(AbstractCheck.Abst + 'Short-Description', 'Description') +@@ -48,6 +52,13 @@ class InitScriptCheck(AbstractCheck.Abst return initscript_list = [] @@ -26,7 +27,7 @@ Index: InitScriptCheck.py for fname, pkgfile in pkg.files().items(): if not fname.startswith('/etc/init.d/') and \ -@@ -60,18 +70,15 @@ class InitScriptCheck(AbstractCheck.Abst +@@ -61,18 +72,15 @@ class InitScriptCheck(AbstractCheck.Abst if dot_in_name_regex.match(basename): printError(pkg, 'init-script-name-with-dot', fname) @@ -54,7 +55,7 @@ Index: InitScriptCheck.py status_found = False reload_found = False -@@ -264,6 +271,17 @@ of chkconfig don't work as expected with +@@ -271,6 +279,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.''',