diff options
author | Niels Thykier <niels@thykier.net> | 2017-11-10 06:17:30 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-11-10 06:17:30 +0000 |
commit | ddc78783969270bb7b95beb233314180bfda2521 (patch) | |
tree | 05d099861d153792a00e4c3ee26b36d11b8944b4 /dh_installsystemd | |
parent | 86d05e41e4549ca01aa27ebf12f68da84b2d45fd (diff) | |
download | debhelper-ddc78783969270bb7b95beb233314180bfda2521.tar.gz |
Revert "dh_installsystemd: Avoid invalid scripts when there are no units"
This reverts commit 86d05e41e4549ca01aa27ebf12f68da84b2d45fd.
Diffstat (limited to 'dh_installsystemd')
-rwxr-xr-x | dh_installsystemd | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/dh_installsystemd b/dh_installsystemd index ebe25a31..671fb480 100755 --- a/dh_installsystemd +++ b/dh_installsystemd @@ -349,20 +349,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) { next if @start_units == 0 && @enable_units == 0; - if (@enable_units) { - for my $unit (sort @enable_units) { - my $base = q{'} . basename($unit) . q{'}; - if ($dh{NO_ENABLE}) { - autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base }); - } else { - autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base }); - } + for my $unit (sort @enable_units) { + my $base = q{'} . basename($unit) . q{'}; + if ($dh{NO_ENABLE}) { + autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base }); + } else { + autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base }); } - my $enableunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @enable_units); - autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $enableunitargs }); } - - next if not @start_units; + my $enableunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @enable_units); + autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $enableunitargs }); + # The $package and $sed parameters are always the same. # This wrapper function makes the following logic easier to read. my $startunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @start_units); |