[SCM] Debian package checker branch, master, updated. 2.2.14-44-gfee7702
The following commit has been merged in the master branch:
commit d187e5b9bf8a319b757afc4d299835f41f18b5e5
Author: Raphael Geissert <atomo64@gmail.com>
Date: Thu Aug 27 13:26:33 2009 -0500
Check for virtual facilities provided by init scripts
Init scripts should not provide virtual facilities via the Provides
header. A separate mechanism is used for that.
diff --git a/checks/init.d b/checks/init.d
index 1feb6ce..ee969c5 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -275,6 +275,14 @@ sub check_init {
}
}
}
+ if ($lsb{'provides'}) {
+ for my $facility (split(/\s+/, $lsb{'provides'})) {
+ if ($facility =~ /^\$/) {
+ tag "init.d-script-provides-virtual-facility-in-header",
+ "/etc/init.d/$_ $facility";
+ }
+ }
+ }
# all tags included in file?
$tag{'start'} or tag "init.d-script-does-not-implement-required-option", "/etc/init.d/$_ start";
diff --git a/checks/init.d.desc b/checks/init.d.desc
index fcea053..be96b18 100644
--- a/checks/init.d.desc
+++ b/checks/init.d.desc
@@ -237,3 +237,14 @@ Info: This <tt>/etc/init.d</tt> script specifies the 6 or 0 runlevel in
to do something that might not exactly be stopping a service at one of
those runlevels the script should anyway specify them in Default-Stop
and perform the actions when passed the <tt>stop</tt> argument.
+
+Tag: init.d-script-provides-virtual-facility-in-header
+Severity: normal
+Certainty: certain
+Info: This <tt>/etc/init.d</tt> script indicates it provides a virtual
+ facility, denoted by the dollar sign in front of the name.
+ Virtual facilities are declared as provided by shipping a file,
+ usually named after the package to avoid file conflicts, that is
+ installed in <tt>/etc/insserv.conf.d</tt> with its content on the
+ following format: <tt>$virtual_facility_name +init-script-name</tt>.
+Ref: http://wiki.debian.org/LSBInitScripts/DebianVirtualFacilities
diff --git a/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init b/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init
index 5971a40..fb50bbb 100644
--- a/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init
+++ b/t/tests/init.d-lsb-headers/debian/debian/init.d-lsb-headers.init
@@ -3,7 +3,7 @@
set -e
### BEGIN INIT INFO
-# Provides: nothing
+# Provides: nothing $bad_facility
# Required-Start:
# Required-Stop:
# Default-Start: 0 6 X
diff --git a/t/tests/init.d-lsb-headers/desc b/t/tests/init.d-lsb-headers/desc
index 2186d53..c82bfb4 100644
--- a/t/tests/init.d-lsb-headers/desc
+++ b/t/tests/init.d-lsb-headers/desc
@@ -7,3 +7,4 @@ Test-For:
init.d-script-has-bad-stop-runlevel
init-d-script-stops-in-s-runlevel
init.d-script-starts-in-stop-runlevel
+ init.d-script-provides-virtual-facility-in-header
diff --git a/t/tests/init.d-lsb-headers/tags b/t/tests/init.d-lsb-headers/tags
index a4a4d27..26263ab 100644
--- a/t/tests/init.d-lsb-headers/tags
+++ b/t/tests/init.d-lsb-headers/tags
@@ -1,5 +1,6 @@
W: init.d-lsb-headers: init-d-script-stops-in-s-runlevel /etc/init.d/init.d-lsb-headers
W: init.d-lsb-headers: init.d-script-has-bad-start-runlevel /etc/init.d/init.d-lsb-headers X
W: init.d-lsb-headers: init.d-script-has-bad-stop-runlevel /etc/init.d/init.d-lsb-headers Y
+W: init.d-lsb-headers: init.d-script-provides-virtual-facility-in-header /etc/init.d/init.d-lsb-headers $bad_facility
W: init.d-lsb-headers: init.d-script-starts-in-stop-runlevel /etc/init.d/init.d-lsb-headers 0
W: init.d-lsb-headers: init.d-script-starts-in-stop-runlevel /etc/init.d/init.d-lsb-headers 6
--
Debian package checker
Reply to: