[lintian] 01/04: Use Lintian::Data instead of hardcoded array for ignore whitelist
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 9ac39ac7a506540b18f1618c8bda1aa1a9f6e55c
Author: Felipe Sateler <fsateler@debian.org>
Date: Thu Jul 16 18:47:00 2015 -0300
Use Lintian::Data instead of hardcoded array for ignore whitelist
Signed-off-by: Niels Thykier <niels@thykier.net>
---
checks/systemd.pm | 8 ++++++--
data/systemd/init-whitelist | 5 +++++
t/tests/systemd-general/debian/debian/rules | 5 +++++
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/checks/systemd.pm b/checks/systemd.pm
index 5319152..fd5b83a 100644
--- a/checks/systemd.pm
+++ b/checks/systemd.pm
@@ -34,6 +34,11 @@ use Text::ParseWords qw(shellwords);
use Lintian::Tags qw(tag);
use Lintian::Util qw(fail lstrip rstrip);
+use Lintian::Data;
+
+# Init script that do not need a service file
+my $INIT_WHITELIST = Lintian::Data->new('systemd/init-whitelist');
+
sub run {
my (undef, undef, $info) = @_;
@@ -63,11 +68,10 @@ sub run {
sub get_init_scripts {
my ($info) = @_;
- my @ignore = ('README','skeleton','rc','rcS',);
my @scripts;
if (my $initd_path = $info->index_resolved_path('etc/init.d/')) {
for my $init_script ($initd_path->children) {
- next if any { $_ eq $init_script->basename } @ignore;
+ next if $INIT_WHITELIST->known($init_script->basename);
next
if $init_script->is_symlink
&& $init_script->link eq '/lib/init/upstart-job';
diff --git a/data/systemd/init-whitelist b/data/systemd/init-whitelist
new file mode 100644
index 0000000..555d48e
--- /dev/null
+++ b/data/systemd/init-whitelist
@@ -0,0 +1,5 @@
+# These are not really init scripts...
+README
+skeleton
+rc
+rcS
diff --git a/t/tests/systemd-general/debian/debian/rules b/t/tests/systemd-general/debian/debian/rules
index 8c12dd7..f952939 100644
--- a/t/tests/systemd-general/debian/debian/rules
+++ b/t/tests/systemd-general/debian/debian/rules
@@ -12,3 +12,8 @@ override_dh_install:
install -m 0755 -d $(INITD_DIR) $(SYSD_DIR)
mkfifo $(INITD_DIR)/fifo-pipe-as-init
mkfifo $(SYSD_DIR)/fifo-pipe-as-init.service
+ touch $(INITD_DIR)/README
+
+override_dh_fixperms:
+ dh_fixperms
+ chmod -x $(INITD_DIR)/README
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: