diff options
author | Dmitry Bogatov <KAction@gnu.org> | 2016-06-09 18:02:54 +0300 |
---|---|---|
committer | Dmitry Bogatov <KAction@gnu.org> | 2016-06-09 18:02:54 +0300 |
commit | 98ca0e7d822a7ddb78a911e85c0f18553fbaa862 (patch) | |
tree | 9d4e21920560d967715a52343d5749c5a98133f7 /dh_runit | |
parent | 1260e2dc07f4d1556380501e5f1010ebed2c27c4 (diff) |
Use filedoublearray to simplify code
Diffstat (limited to 'dh_runit')
-rwxr-xr-x | dh_runit | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -9,7 +9,6 @@ dh_runit - install/enable runit runscripts | |||
9 | use strict; | 9 | use strict; |
10 | use Debian::Debhelper::Dh_Lib; | 10 | use Debian::Debhelper::Dh_Lib; |
11 | use File::Find; | 11 | use File::Find; |
12 | use Path::Tiny; | ||
13 | use File::stat; | 12 | use File::stat; |
14 | use feature 'signatures'; | 13 | use feature 'signatures'; |
15 | no warnings 'experimental::signatures'; | 14 | no warnings 'experimental::signatures'; |
@@ -85,10 +84,8 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { | |||
85 | 84 | ||
86 | doit('install', '-d', $sv_dir); | 85 | doit('install', '-d', $sv_dir); |
87 | 86 | ||
88 | for my $line (path($runit)->lines) { | 87 | for my $words (filedoublearray($runit)) { |
89 | next if ($line =~ /^#/); # skip comments | 88 | (my $enable, my $path, my $name) = @{$words}; |
90 | next if ($line =~ /^\s*$/); # skip empty lines | ||
91 | (my $enable, my $path, my $name) = split /\s/, $line; | ||
92 | $name = $name || basename($path); | 89 | $name = $name || basename($path); |
93 | 90 | ||
94 | error("can't read `$path'") unless -r $path; | 91 | error("can't read `$path'") unless -r $path; |
@@ -110,3 +107,5 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { | |||
110 | autoscript($pkg, 'prerm', 'prerm-runit', "s/#NAME#/$name/"); | 107 | autoscript($pkg, 'prerm', 'prerm-runit', "s/#NAME#/$name/"); |
111 | } | 108 | } |
112 | } | 109 | } |
110 | |||
111 | # PROMISE: DH NOOP WITHOUT runit | ||