[debhelper-devel] [debhelper] 01/01: dh_*: add /g to more sed replacements in autoscript calls

Niels Thykier nthykier at moszumanska.debian.org
Thu Dec 3 13:13:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit d5cb76cf603a64d1493b0ff7d329dbb5cc28addb
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Dec 3 13:13:24 2015 +0000

    dh_*: add /g to more sed replacements in autoscript calls
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog  |  2 ++
 dh_icons          |  4 ++--
 dh_installemacsen |  6 +++---
 dh_installinit    | 14 +++++++-------
 dh_installmenu    |  4 ++--
 dh_installwm      |  6 +++---
 dh_installxfonts  |  4 ++--
 dh_ucf            |  4 ++--
 8 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b577549..cee33e6 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 at thykier.net>  Sat, 28 Nov 2015 09:18:02 +0100
 
diff --git a/dh_icons b/dh_icons
index f2b6d7a..dd305f5 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 b56fb8b..26a2fc7 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 d0f351c..f427009 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 3c1d84d..adca9d6 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 a72e3c7..2cceeae 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 bf48aaf..484aaed 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 409e950..27c2923 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");
 		}
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list