summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2015-12-03 13:13:24 +0000
committerNiels Thykier <niels@thykier.net>2015-12-03 13:13:31 +0000
commitd5cb76cf603a64d1493b0ff7d329dbb5cc28addb (patch)
tree3e0af29c63ea4e3cabbe67954f3f4d342430896b
parentcf096da13582deb0cf0c0c910f70a05cbaa0b0c1 (diff)
downloaddebhelper-d5cb76cf603a64d1493b0ff7d329dbb5cc28addb.tar.gz
dh_*: add /g to more sed replacements in autoscript calls
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog2
-rwxr-xr-xdh_icons4
-rwxr-xr-xdh_installemacsen6
-rwxr-xr-xdh_installinit14
-rwxr-xr-xdh_installmenu4
-rwxr-xr-xdh_installwm6
-rwxr-xr-xdh_installxfonts4
-rwxr-xr-xdh_ucf4
8 files changed, 23 insertions, 21 deletions
diff --git a/debian/changelog b/debian/changelog
index b5775498..cee33e6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ debhelper (9.20151126+unreleased) UNRELEASED; urgency=medium
temporary files put in postinst. (Closes: #806392)
* dh_installinit: Import change from Ubuntu to add /g
modifier when substituting the auto-script snippets.
+ * dh_*: Add /g when substituting the auto-script snippts in
+ other commands as well.
-- Niels Thykier <niels@thykier.net> Sat, 28 Nov 2015 09:18:02 +0100
diff --git a/dh_icons b/dh_icons
index f2b6d7a4..dd305f5c 100755
--- a/dh_icons
+++ b/dh_icons
@@ -63,8 +63,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
if (@dirlist and ! $dh{NOSCRIPTS}) {
my $list=join(" ", sort @dirlist);
- autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%");
- autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%");
+ autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%g");
+ autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%g");
}
}
}
diff --git a/dh_installemacsen b/dh_installemacsen
index b56fb8b7..26a2fc75 100755
--- a/dh_installemacsen
+++ b/dh_installemacsen
@@ -131,11 +131,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($emacsen_install ne '' || $emacsen_remove ne '') {
if (! $dh{NOSCRIPTS}) {
autoscript($package,"preinst","preinst-emacsen",
- "s/#PACKAGE#/$package/");
+ "s/#PACKAGE#/$package/g");
autoscript($package,"postinst","postinst-emacsen",
- "s/#PACKAGE#/$package/");
+ "s/#PACKAGE#/$package/g");
autoscript($package,"prerm","prerm-emacsen",
- "s/#PACKAGE#/$package/");
+ "s/#PACKAGE#/$package/g");
}
}
}
diff --git a/dh_installinit b/dh_installinit
index d0f351c7..f427009d 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -274,7 +274,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}, $tmp);
if (@tmpfiles > 0) {
autoscript($package,"postinst", "postinst-init-tmpfiles",
- "s,#TMPFILES#," . join(" ", sort @tmpfiles).",");
+ "s,#TMPFILES#," . join(" ", sort @tmpfiles).",g");
}
}
@@ -296,34 +296,34 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
# update-rc.d, and restart (or
# start if new install) script
autoscript($package,"postinst", "postinst-init-restart",
- "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
+ "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/g;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/g");
}
else {
# update-rc.d, and start script
autoscript($package,"postinst", "postinst-init",
- "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
+ "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/g;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/g");
}
if ($dh{R_FLAG} || $dh{RESTART_AFTER_UPGRADE}) {
# stops script only on remove
autoscript($package,"prerm","prerm-init-norestart",
- "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
+ "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/g;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/g");
}
else {
# always stops script
autoscript($package,"prerm","prerm-init",
- "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
+ "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/g;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/g");
}
}
else {
# just update-rc.d
autoscript($package,"postinst", "postinst-init-nostart",
- "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
+ "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/g;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/g");
}
# removes rc.d links
autoscript($package,"postrm","postrm-init",
- "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/");
+ "s/#SCRIPT#/$script/g;s/#INITPARMS#/$params/g;s/#ERROR_HANDLER#/$dh{ERROR_HANDLER}/g");
}
}
}
diff --git a/dh_installmenu b/dh_installmenu
index 3c1d84da..adca9d6e 100755
--- a/dh_installmenu
+++ b/dh_installmenu
@@ -81,8 +81,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/");
- autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/");
+ autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/g");
+ autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/g");
}
}
}
diff --git a/dh_installwm b/dh_installwm
index a72e3c73..2cceeae1 100755
--- a/dh_installwm
+++ b/dh_installwm
@@ -91,14 +91,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if (! $dh{NOSCRIPTS}) {
WM: foreach my $wm (@wm) {
- autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:");
+ autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:g");
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:;s:#WMMAN#:$wmman.gz:;s/#PRIORITY#/$dh{PRIORITY}/",);
+ autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:g;s:#WMMAN#:$wmman.gz:g;s/#PRIORITY#/$dh{PRIORITY}/g",);
next WM;
}
}
@@ -107,7 +107,7 @@ WM: foreach my $wm (@wm) {
error("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:;s/#PRIORITY#/$dh{PRIORITY}/",);
+ autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:g;s/#PRIORITY#/$dh{PRIORITY}/g",);
}
}
}
diff --git a/dh_installxfonts b/dh_installxfonts
index bf48aafe..484aaedb 100755
--- a/dh_installxfonts
+++ b/dh_installxfonts
@@ -79,9 +79,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
autoscript($package, "postinst", "postinst-xfonts",
- "s:#CMDS#:".join(";", @cmds, @cmds_postinst).":");
+ "s:#CMDS#:".join(";", @cmds, @cmds_postinst).":g");
autoscript($package, "postrm", "postrm-xfonts",
- "s:#CMDS#:".join(";", @cmds, @cmds_postrm).":");
+ "s:#CMDS#:".join(";", @cmds, @cmds_postrm).":g");
addsubstvar($package, "misc:Depends", "xfonts-utils");
}
diff --git a/dh_ucf b/dh_ucf
index 409e9503..27c29239 100755
--- a/dh_ucf
+++ b/dh_ucf
@@ -77,8 +77,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
foreach my $set (@ucf) {
my $src = $set->[0];
my $dest = $set->[1];
- autoscript($package,"postinst","postinst-ucf","s:#UCFSRC#:$src:;s:#UCFDEST#:$dest:;s/#PACKAGE#/$package/",);
- autoscript($package,"postrm","postrm-ucf","s:#UCFDEST#:$dest:;s/#PACKAGE#/$package/");
+ autoscript($package,"postinst","postinst-ucf","s:#UCFSRC#:$src:g;s:#UCFDEST#:$dest:g;s/#PACKAGE#/$package/g",);
+ autoscript($package,"postrm","postrm-ucf","s:#UCFDEST#:$dest:g;s/#PACKAGE#/$package/g");
}
}
}