[SCM] Debian package checker branch, master, updated. 2.3.3-21-g63ba2e6
The following commit has been merged in the master branch:
commit 63ba2e6c2dff886e83350739f9ba5baed0291e86
Author: Russ Allbery <rra@debian.org>
Date: Sat Mar 20 15:40:14 2010 -0700
Exclude init script symlinks to upstart-job from syntax checks
* checks/init.d:
+ [RA] Exclude symlinks to upstart-job from init script syntax checks.
Based on a patch by Jos Boumans. (Closes: #569492)
diff --git a/checks/init.d b/checks/init.d
index 61098b6..8c2bd2a 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -182,13 +182,14 @@ opendir(INITD, "init.d") or fail("cannot read init.d directory: $!");
for (readdir(INITD)) {
my $script = $_;
next if grep {$script eq $_} qw(. .. README skeleton rc rcS);
- # don't check upstart jobs. See Ubuntu bug report:
- # https://bugs.launchpad.net/ubuntu/+source/lintian/+bug/496798
- next if -l "init.d/$script" and readlink("init.d/$script") =~ m|lib/init/upstart-job$|;
- $_ = $script;
- unless ($initd_postinst{$_}) {
- tag "script-in-etc-init.d-not-registered-via-update-rc.d", "/etc/init.d/$_";
- check_init("init.d/$_") if -f "init.d/$_";
+
+ # If $initd_postinst is true for this script, we already checked the
+ # syntax in the above loop. Check the syntax of unregistered scripts so
+ # that we get more complete Lintian coverage in the first pass.
+ unless ($initd_postinst{$script}) {
+ tag 'script-in-etc-init.d-not-registered-via-update-rc.d',
+ "/etc/init.d/$script";
+ check_init("init.d/$script") if -f "init.d/$script";
}
}
closedir(INITD);
@@ -197,6 +198,16 @@ closedir(INITD);
sub check_init {
my ($initd_file) = @_;
+
+ # In an upstart system, such as Ubuntu, init scripts are symlinks to
+ # upstart-job. It doesn't make sense to check the syntax of upstart-job,
+ # so skip the checks of the init script itself in that case.
+ if (-l $initd_file) {
+ my $target = readlink($initd_file);
+ if ($target =~ m,(?:\A|/)lib/init/upstart-job\z,) {
+ return;
+ }
+ }
open(IN, '<', $initd_file)
or fail("cannot open init.d file $initd_file: $!");
my (%tag, %lsb);
diff --git a/debian/changelog b/debian/changelog
index 673df5c..2e3de75 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ lintian (2.3.4) UNRELEASED; urgency=low
+ [RG] Update package-depends-on-hardcoded-libc exception to also
exclude eglibc. Based on a patch from Cyril Brulebois.
(Closes: #573398)
+ * checks/init.d:
+ + [RA] Exclude symlinks to upstart-job from init script syntax checks.
+ Based on a patch by Jos Boumans. (Closes: #569492)
* checks/rules:
+ [RA] Allow ant1.7 to satisfy a build requirement for ant. Thanks,
Rene Engelhard. (Closes: #572430)
diff --git a/t/tests/init.d-symlink/debian/debian/links b/t/tests/init.d-symlink/debian/debian/links
index b7a740f..2fe7261 100644
--- a/t/tests/init.d-symlink/debian/debian/links
+++ b/t/tests/init.d-symlink/debian/debian/links
@@ -1 +1,2 @@
/lib/init/upstart-job etc/init.d/lintian
+/lib/init/upstart-job etc/init.d/lintian-unreg
diff --git a/t/tests/init.d-symlink/desc b/t/tests/init.d-symlink/desc
index cdfd293..b56407c 100644
--- a/t/tests/init.d-symlink/desc
+++ b/t/tests/init.d-symlink/desc
@@ -5,3 +5,5 @@ Description: Check proper handling of symlinked init scripts
Test-Against:
init.d-script-not-included-in-package
init.d-script-not-marked-as-conffile
+Test-For:
+ script-in-etc-init.d-not-registered-via-update-rc.d
diff --git a/t/tests/init.d-symlink/tags b/t/tests/init.d-symlink/tags
index e69de29..68a0c34 100644
--- a/t/tests/init.d-symlink/tags
+++ b/t/tests/init.d-symlink/tags
@@ -0,0 +1 @@
+W: init.d-symlink: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/lintian-unreg
--
Debian package checker
Reply to: