Subject: [PATCH 4/5] Don't treat /etc/init.d/README as an init script

From: Raphael Geissert <[email-masked]>
Date: Tue, 16 Jun 2009 15:07:40 -0500

---
 checks/init.d                                      |    2 +-
 t/tests/init.d-script-registration/debian/README   |    1 +
 .../debian/debian/install                          |    1 +
 .../init.d-script-registration/debian/debian/rules |    9 +++++++++
 4 files changed, 12 insertions(+), 1 deletions(-)
 create mode 100644 t/tests/init.d-script-registration/debian/README
 create mode 100644 t/tests/init.d-script-registration/debian/debian/rules

diff --git a/checks/init.d b/checks/init.d
index f134ed0..c2dd98a 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -160,7 +160,7 @@ for (keys %initd_postinst) {
 # files actually installed in /etc/init.d should match our list :-)
 opendir(INITD, "init.d") or fail("cannot read init.d directory: $!");
 for (readdir(INITD)) {
-    next if $_ eq '.' || $_ eq '..';
+    next if $_ eq '.' || $_ eq '..' || $_ eq 'README';
     unless ($initd_postinst{$_}) {
 	tag "script-in-etc-init.d-not-registered-via-update-rc.d", "/etc/init.d/$_";
 	checkinit("init.d/$_");
diff --git a/t/tests/init.d-script-registration/debian/README b/t/tests/init.d-script-registration/debian/README
new file mode 100644
index 0000000..09dd11b
--- /dev/null
+++ b/t/tests/init.d-script-registration/debian/README
@@ -0,0 +1 @@
+Just a dummy file (normally with instructions), not an init script at all!
diff --git a/t/tests/init.d-script-registration/debian/debian/install b/t/tests/init.d-script-registration/debian/debian/install
index 57fadcb..dcfc064 100644
--- a/t/tests/init.d-script-registration/debian/debian/install
+++ b/t/tests/init.d-script-registration/debian/debian/install
@@ -1 +1,2 @@
 foo.in /etc/init.d/
+README /etc/init.d/
diff --git a/t/tests/init.d-script-registration/debian/debian/rules b/t/tests/init.d-script-registration/debian/debian/rules
new file mode 100644
index 0000000..be15443
--- /dev/null
+++ b/t/tests/init.d-script-registration/debian/debian/rules
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+%:
+	dh $*
+
+binary:
+	dh $@ --until dh_fixperms
+	chmod -x debian/init.d-script-registration/etc/init.d/README
+	dh $@ --remaining
-- 
1.6.3.1