summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog9
-rwxr-xr-xdh_icons4
-rwxr-xr-xdh_installcatalogs2
-rwxr-xr-xdh_installemacsen6
-rwxr-xr-xdh_installmenu4
-rwxr-xr-xdh_installmodules4
-rwxr-xr-xdh_installwm6
-rwxr-xr-xdh_installxfonts4
-rwxr-xr-xdh_systemd_enable6
-rwxr-xr-xdh_systemd_start2
10 files changed, 28 insertions, 19 deletions
diff --git a/debian/changelog b/debian/changelog
index 1beaa02e..4563d9c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,15 @@ debhelper (10.7) UNRELEASED; urgency=medium
variant) avoids forking a lot of subprocesses and need not worry
about a shell possible interpreting metacharacters.
* dh_installman: Pass "-l" to man when recoding the manpages.
+ * dh_icons: Use hashref based autoscripts generation.
+ * dh_installcatalogs: Ditto.
+ * dh_installemacsen: Ditto.
+ * dh_installmenu: Ditto.
+ * dh_installmodules: Ditto.
+ * dh_installwm: Ditto.
+ * dh_installxfonts: Ditto.
+ * dh_systemd_enable: Ditto.
+ * dh_systemd_start: Ditto.
-- Niels Thykier <niels@thykier.net> Sat, 15 Jul 2017 09:42:32 +0000
diff --git a/dh_icons b/dh_icons
index b7e84532..73240ec4 100755
--- a/dh_icons
+++ b/dh_icons
@@ -66,8 +66,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
closedir($dirfd);
if (@dirlist and ! $dh{NOSCRIPTS}) {
my $list=join(" ", sort @dirlist);
- autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%g");
- autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%g");
+ autoscript($package, 'postinst', 'postinst-icons', { 'DIRLIST' => $list });
+ autoscript($package, 'postrm', 'postrm-icons', { 'DIRLIST' => $list });
}
}
}
diff --git a/dh_installcatalogs b/dh_installcatalogs
index f15a6878..d7ac9a68 100755
--- a/dh_installcatalogs
+++ b/dh_installcatalogs
@@ -113,7 +113,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if (! $dh{NOSCRIPTS}) {
autotrigger($package, "activate-await", "update-sgmlcatalog");
autoscript($package, "postrm", "postrm-sgmlcatalog",
- "s%#CENTRALCAT#%$centralcat%g;");
+ { 'CENTRALCAT' => $centralcat });
}
}
else {
diff --git a/dh_installemacsen b/dh_installemacsen
index fcae6dfe..2e19c1f6 100755
--- a/dh_installemacsen
+++ b/dh_installemacsen
@@ -125,11 +125,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($emacsen_install ne '' || $emacsen_remove ne '') {
if (! $dh{NOSCRIPTS}) {
autoscript($package,"preinst","preinst-emacsen",
- "s/#PACKAGE#/$package/g");
+ { 'PACKAGE' => $package });
autoscript($package,"postinst","postinst-emacsen",
- "s/#PACKAGE#/$package/g");
+ { 'PACKAGE' => $package });
autoscript($package,"prerm","prerm-emacsen",
- "s/#PACKAGE#/$package/g");
+ { 'PACKAGE' => $package });
}
}
}
diff --git a/dh_installmenu b/dh_installmenu
index 3bad1292..475b58f6 100755
--- a/dh_installmenu
+++ b/dh_installmenu
@@ -79,8 +79,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
install_file($menu_method,"$tmp/etc/menu-methods/$package");
if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/g");
- autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/g");
+ autoscript($package, 'postinst', 'postinst-menu-method', { 'PACKAGE' => $package });
+ autoscript($package, 'postrm', 'postrm-menu-method', { 'PACKAGE' => $package });
}
}
}
diff --git a/dh_installmodules b/dh_installmodules
index 40d42336..46ef0241 100755
--- a/dh_installmodules
+++ b/dh_installmodules
@@ -100,8 +100,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if (! $dh{NOSCRIPTS}) {
foreach my $kvers (find_kernel_modules("$tmp/lib/modules")) {
- autoscript($package,"postinst","postinst-modules","s/#KVERS#/$kvers/g");
- autoscript($package,"postrm","postrm-modules","s/#KVERS#/$kvers/g");
+ autoscript($package, 'postinst', 'postinst-modules', { 'KVERS' => $kvers });
+ autoscript($package, 'postrm', 'postrm-modules', { 'KVERS' => $kvers });
}
}
}
diff --git a/dh_installwm b/dh_installwm
index 4290b757..1be2500a 100755
--- a/dh_installwm
+++ b/dh_installwm
@@ -96,14 +96,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if (! $dh{NOSCRIPTS}) {
WM: foreach my $wm (@wm) {
- autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:g");
+ autoscript($package,"prerm","prerm-wm", { 'WM' => $wm });
my $wmman;
if (! compat(5)) {
foreach my $ext (".1", ".1x") {
$wmman="/usr/share/man/man1/".basename($wm).$ext;
if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") {
- autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:g;s:#WMMAN#:$wmman.gz:g;s/#PRIORITY#/$dh{PRIORITY}/g",);
+ autoscript($package,"postinst","postinst-wm", { 'WM' => $wm, 'WMMAN' => "${wmman}.gz" , 'PRIORITY' => $dh{PRIORITY} });
next WM;
}
}
@@ -114,7 +114,7 @@ WM: foreach my $wm (@wm) {
warning("no manpage found (creating an x-window-manager alternative requires a slave symlink for the manpage)");
}
# Reaching this code means a broken package will be produced.
- autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:g;s/#PRIORITY#/$dh{PRIORITY}/g",);
+ autoscript($package,"postinst","postinst-wm-noman", { 'WM' => $wm, 'PRIORITY' => $dh{PRIORITY} });
}
}
}
diff --git a/dh_installxfonts b/dh_installxfonts
index cc05aa56..444dc194 100755
--- a/dh_installxfonts
+++ b/dh_installxfonts
@@ -81,9 +81,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
autoscript($package, "postinst", "postinst-xfonts",
- "s:#CMDS#:".join(";", @cmds, @cmds_postinst).":g");
+ { 'CMDS' => join(";", @cmds, @cmds_postinst) });
autoscript($package, "postrm", "postrm-xfonts",
- "s:#CMDS#:".join(";", @cmds, @cmds_postrm).":g");
+ { 'CMDS' => join(";", @cmds, @cmds_postrm) });
addsubstvar($package, "misc:Depends", "xfonts-utils");
}
diff --git a/dh_systemd_enable b/dh_systemd_enable
index 9a256b0c..c06f3c0f 100755
--- a/dh_systemd_enable
+++ b/dh_systemd_enable
@@ -255,12 +255,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
for my $unit (sort @units) {
my $base = basename($unit);
if ($dh{NO_ENABLE}) {
- autoscript($package, "postinst", "postinst-systemd-dont-enable", "s/#UNITFILE#/$base/");
+ autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base });
} else {
- autoscript($package, "postinst", "postinst-systemd-enable", "s/#UNITFILE#/$base/");
+ autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base });
}
}
- autoscript($package, "postrm", "postrm-systemd", "s/#UNITFILES#/$unitargs/");
+ autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $unitargs });
# init-system-helpers ships deb-systemd-helper which we use in our
# autoscripts
diff --git a/dh_systemd_start b/dh_systemd_start
index 740a3117..5c0297c3 100755
--- a/dh_systemd_start
+++ b/dh_systemd_start
@@ -223,7 +223,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $sd_autoscript = sub {
my ($script, $filename) = @_;
my $unitargs = join(" ", sort map { basename($_) } @units);
- autoscript($package, $script, $filename, "s/#UNITFILES#/$unitargs/");
+ autoscript($package, $script, $filename, { 'UNITFILES' => $unitargs });
};
if ($dh{RESTART_AFTER_UPGRADE}) {