From bf8aa790612fdce15a68b62356d1c06f2c190e0a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Mar 2012 17:37:54 -0400 Subject: Revert avoid expanding shell metacharacters in sed call in autoscript(). It breaks dh_usrlocal and must be considered part of its interface. Added to interface documentation. Closes: #665263 --- Debian/Debhelper/Dh_Lib.pm | 4 ++-- debian/changelog | 9 +++++++++ doc/PROGRAMMING | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 7073aa4e..e0a274a4 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -533,14 +533,14 @@ sub autoscript { && !compat(5)) { # Add fragments to top so they run in reverse order when removing. complex_doit("echo \"# Automatically added by ".basename($0)."\"> $outfile.new"); - complex_doit("sed '$sed' $infile >> $outfile.new"); + complex_doit("sed \"$sed\" $infile >> $outfile.new"); complex_doit("echo '# End automatically added section' >> $outfile.new"); complex_doit("cat $outfile >> $outfile.new"); complex_doit("mv $outfile.new $outfile"); } else { complex_doit("echo \"# Automatically added by ".basename($0)."\">> $outfile"); - complex_doit("sed '$sed' $infile >> $outfile"); + complex_doit("sed \"$sed\" $infile >> $outfile"); complex_doit("echo '# End automatically added section' >> $outfile"); } } diff --git a/debian/changelog b/debian/changelog index 89ebeb2e..ba688342 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (9.20120313) UNRELEASED; urgency=low + + * Revert avoid expanding shell metacharacters in sed call in autoscript(). + It breaks dh_usrlocal and must be considered part of its interface. + Added to interface documentation. + Closes: #665263 + + -- Joey Hess Thu, 22 Mar 2012 17:35:48 -0400 + debhelper (9.20120312) unstable; urgency=low * Also include CFLAGS in ld line for perl. Closes: #662666 diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index b6d3d16e..bcf1c13c 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -197,7 +197,7 @@ autoscript($package, $scriptname, $snippetname, $sedcommands) - script to add to - filename of snippet - sed commands to run on the snippet. Ie, s/#PACKAGE#/$PACKAGE/ - (optional) + (optional) Note: Passed to the shell inside double quotes. This command automatically adds shell script snippets to a debian maintainer script (like the postinst or prerm). Note that in v6 mode and up, the snippets are added in reverse -- cgit v1.2.3