2011-05-02 13:56:54 +02:00
|
|
|
Index: InitScriptCheck.py
|
|
|
|
===================================================================
|
|
|
|
--- InitScriptCheck.py.orig
|
2011-04-21 12:12:02 +02:00
|
|
|
+++ InitScriptCheck.py
|
2012-09-13 18:01:40 +02:00
|
|
|
@@ -51,7 +51,7 @@ class InitScriptCheck(AbstractCheck.Abst
|
2011-04-21 12:12:02 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
initscript_list = []
|
|
|
|
-
|
|
|
|
+ rclinks = set()
|
|
|
|
|
|
|
|
# check chkconfig call in %post and %preun
|
2012-09-13 18:01:40 +02:00
|
|
|
postin = pkg[rpm.RPMTAG_POSTIN] or pkg.scriptprog(pkg[rpm.RPMTAG_POSTINPROG])
|
|
|
|
@@ -60,6 +60,10 @@ class InitScriptCheck(AbstractCheck.Abst
|
2011-04-21 12:12:02 +02:00
|
|
|
|
|
|
|
for fname, pkgfile in pkg.files().items():
|
|
|
|
|
2011-05-02 13:56:54 +02:00
|
|
|
+ if stat.S_ISLNK(pkgfile.mode) and (fname.startswith("/usr/sbin/rc") \
|
|
|
|
+ or fname.startswith("/sbin/rc")):
|
2011-04-21 12:12:02 +02:00
|
|
|
+ rclinks.add(fname.partition('/rc')[2])
|
|
|
|
+
|
|
|
|
if not fname.startswith('/etc/init.d/') and \
|
|
|
|
not fname.startswith('/etc/rc.d/init.d/'):
|
|
|
|
continue
|
2012-09-13 18:01:40 +02:00
|
|
|
@@ -199,6 +203,12 @@ class InitScriptCheck(AbstractCheck.Abst
|
2011-05-31 13:31:05 +02:00
|
|
|
elif subsys_regex_found and not use_subsys:
|
|
|
|
printError(pkg, 'subsys-unsupported', fname)
|
2011-04-21 12:12:02 +02:00
|
|
|
|
|
|
|
+ for script in initscript_list:
|
|
|
|
+ if script.startswith("rc") or script.startswith("boot."):
|
|
|
|
+ continue
|
|
|
|
+ if not script in rclinks:
|
|
|
|
+ printWarning(pkg, 'suse-missing-rclink', script)
|
|
|
|
+
|
2012-09-13 18:01:40 +02:00
|
|
|
if len(initscript_list) == 1:
|
|
|
|
pkgname = re.sub("-sysvinit$", "", pkg.name.lower())
|
|
|
|
goodnames = (pkgname, pkgname + 'd')
|
|
|
|
@@ -223,6 +233,10 @@ a call to chkconfig.''',
|
2011-05-02 13:56:54 +02:00
|
|
|
'''The package contains an init script but doesn't contain a %preun with
|
|
|
|
a call to chkconfig.''',
|
2011-04-21 12:12:02 +02:00
|
|
|
|
|
|
|
+'suse-missing-rclink',
|
|
|
|
+'''The package contains an init script with the given name but does not
|
2011-05-02 13:56:54 +02:00
|
|
|
+contain the SUSE policy symlink /usr/sbin/rcFOO -> /etc/init.d/FOO''',
|
2011-04-21 12:12:02 +02:00
|
|
|
+
|
|
|
|
'preun-without-chkconfig',
|
|
|
|
'''The package contains an init script but doesn't call chkconfig in its
|
|
|
|
%preun script.''',
|