[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.2.14-44-gfee7702



The following commit has been merged in the master branch:
commit 2d2fc56b4166484a99debbb9be8048997e37be2d
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Thu Aug 27 13:50:22 2009 -0500

    Check for no LSB header provides matching the init script

diff --git a/checks/init.d b/checks/init.d
index ee969c5..958e653 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -276,12 +276,17 @@ sub check_init {
 	}
     }
     if ($lsb{'provides'}) {
+	my $named_after_script = 0;
 	for my $facility (split(/\s+/, $lsb{'provides'})) {
 	    if ($facility =~ /^\$/) {
 		tag "init.d-script-provides-virtual-facility-in-header",
 		    "/etc/init.d/$_ $facility";
 	    }
+	    $named_after_script = 1
+		if ($_ =~ m/^\Q$facility\E(?:.sh)?$/);
 	}
+	tag "init.d-script-provides-not-after-its-name", "/etc/init.d/$_"
+	    unless ($named_after_script);
     }
 
     # all tags included in file?
diff --git a/checks/init.d.desc b/checks/init.d.desc
index be96b18..3650cdb 100644
--- a/checks/init.d.desc
+++ b/checks/init.d.desc
@@ -248,3 +248,13 @@ Info: This <tt>/etc/init.d</tt> script indicates it provides a virtual
  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
+
+Tag: init.d-script-provides-not-after-its-name
+Severity: normal
+Certainty: possible
+Info: This <tt>/etc/init.d</tt> script indicates it provides one or
+ more facilities but none is named after the name of the init script.
+ Although in certain cases it might be necessary not to follow that
+ naming convention, in most cases that's the right way to name the
+ facility provided by the init script.
+Ref: http://wiki.debian.org/LSBInitScripts
diff --git a/t/tests/init.d-lsb-headers/desc b/t/tests/init.d-lsb-headers/desc
index c82bfb4..87544a8 100644
--- a/t/tests/init.d-lsb-headers/desc
+++ b/t/tests/init.d-lsb-headers/desc
@@ -8,3 +8,4 @@ Test-For:
  init-d-script-stops-in-s-runlevel
  init.d-script-starts-in-stop-runlevel
  init.d-script-provides-virtual-facility-in-header
+ init.d-script-provides-not-after-its-name
diff --git a/t/tests/init.d-lsb-headers/tags b/t/tests/init.d-lsb-headers/tags
index 26263ab..b2479fa 100644
--- a/t/tests/init.d-lsb-headers/tags
+++ b/t/tests/init.d-lsb-headers/tags
@@ -1,6 +1,7 @@
 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-not-after-its-name /etc/init.d/init.d-lsb-headers
 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: