diff options
author | Niels Thykier <niels@thykier.net> | 2017-07-15 13:29:48 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-07-22 17:29:38 +0000 |
commit | 99a07068640f57cbab2a88511c221802d505b19e (patch) | |
tree | d54f4d6e3823d99fab07d450d6a533de371cba48 /doc/PROGRAMMING | |
parent | 9b2bb8378582ee39f40e01a98b907ddf1b887e5d (diff) | |
download | debhelper-99a07068640f57cbab2a88511c221802d505b19e.tar.gz |
autoscript: Support hashref for substitution
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'doc/PROGRAMMING')
-rw-r--r-- | doc/PROGRAMMING | 14 |
1 files changed, 8 insertions, 6 deletions
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 |