From 99a07068640f57cbab2a88511c221802d505b19e Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sat, 15 Jul 2017 13:29:48 +0000 Subject: autoscript: Support hashref for substitution Signed-off-by: Niels Thykier --- doc/PROGRAMMING | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'doc/PROGRAMMING') diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 1115d998..5befe565 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -239,16 +239,18 @@ isnative($package) is a native debian package. As a side effect, $dh{VERSION} is set to the version number of the package. -autoscript($package, $scriptname, $snippetname, $sedcommands || $sub) +autoscript($package, $scriptname, $snippetname, $substparam) Pass parameters: - binary package to be affected - script to add to - filename of snippet - - (optional) EITHER sed commands to run on the snippet. Ie, - s/#PACKAGE#/$PACKAGE/ Note: Passed to the shell inside double - quotes. - OR a perl sub to invoke with $_ set to each line of the snippet in - turn. + - (optional) A substitution parameter, which is one of 3 times: + * sed commands to run on the snippet. E.g. s/#PACKAGE#/$PACKAGE/ + Note: Passed to the shell inside double quotes. + * a perl sub to invoke with $_ set to each line of the snippet + in turn. + * a hashref, where each key will substitute "#${key}#" with the + value that $key points to. [debhelper (>= 10.7)] 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