diff options
author | Niels Thykier <niels@thykier.net> | 2016-10-02 20:11:34 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2016-10-02 20:11:37 +0000 |
commit | dbdad391cc62fc92f54d8f9eab1f4bc68c1073cb (patch) | |
tree | 3a9a8a913bbef2549e0b40b089cbb43179ab90a6 /dh_installinit | |
parent | 56e7dc4f2a6b47007364ec7f4e3dee1eba2f21c8 (diff) | |
download | debhelper-dbdad391cc62fc92f54d8f9eab1f4bc68c1073cb.tar.gz |
Refactor install_dir usage to avoid the "if -d " tests
They were not needed in the first place (as "install -d" DTRT).
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_installinit')
-rwxr-xr-x | dh_installinit | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/dh_installinit b/dh_installinit index a79113ab..087a3bd8 100755 --- a/dh_installinit +++ b/dh_installinit @@ -219,37 +219,26 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $service=pkgfile($package,"service"); if ($service ne '' && ! $dh{ONLYSCRIPTS}) { my $path="$tmp/lib/systemd/system"; - if (! -d $path) { - install_dir($path); - } - + install_dir($path); install_file($service, "$path/$script.service"); } my $tmpfile=pkgfile($package,"tmpfile"); if ($tmpfile ne '' && ! $dh{ONLYSCRIPTS}) { my $path="$tmp/usr/lib/tmpfiles.d"; - if (! -d $path) { - install_dir($path); - } - + install_dir($path); install_file($tmpfile, "$path/$script.conf"); } my $job=pkgfile($package,"upstart"); if ($job ne '' && ! $dh{ONLYSCRIPTS}) { - if (! -d "$tmp/etc/init") { - install_dir("$tmp/etc/init"); - } - + install_dir("$tmp/etc/init"); install_file($job, "$tmp/etc/init/$jobfile.conf"); } my $default=pkgfile($package,'default'); if ($default ne '' && ! $dh{ONLYSCRIPTS}) { - if (! -d "$tmp/etc/default") { - install_dir("$tmp/etc/default"); - } + install_dir("$tmp/etc/default"); install_file($default, "$tmp/etc/default/$script"); } @@ -257,10 +246,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { pkgfile($package,"init.d"); if ($init ne '' && ! $dh{ONLYSCRIPTS}) { - if (! -d "$tmp/etc/init.d") { - install_dir("$tmp/etc/init.d"); - } - + install_dir("$tmp/etc/init.d"); install_prog($init,"$tmp/etc/init.d/$script"); } |