From ab9fa9bc99f801ff3a9fadd5f43bf2bf28a423d0 Mon Sep 17 00:00:00 2001 From: "Bernhard R. Link" Date: Mon, 29 Dec 2014 12:35:42 +0100 Subject: add DH_QUIET environment variable Add a DH_QUIET environment variable to make debhelper more silent if set (unless DH_VERBOSE is set). Add new helper functions print_and_doit, print_and_doint_noerror, and nonquiet_print. If DH_QUIET is set, disable printing of dh subcommands to be run. Describe effects DH_QUIET should have in doc/PROGRAMMING. --- doc/PROGRAMMING | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/PROGRAMMING') diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 6ba207f1..e16975f0 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -18,6 +18,11 @@ output the commands, you should indent them with 1 tab). This is so we don't have a lot of noise output when all the debhelper commands in a debian/rules are run, so the important stuff is clearly visible. +An exception to above rule are dh_auto_* commands and dh itself. They will +also print the commands interacting with the upstream build system and which +of the simple debhelper programms are called. (i.e. print what a traditional +non-dh(1) using debian/rules would print but nothing else). + Debhelper programs should accept all options listed in the "SHARED DEBHELPER OPTIONS" section of debhelper(7), including any long forms of these options, like --verbose . If necessary, the options may be ignored. @@ -152,6 +157,9 @@ doit(@command) if $dh{VERBOSE} is set, it will also output the command to stdout. You should use this function for almost all commands your program performs that manipulate files in the package build directories. +print_and_doit(@command) + Like doit but will print unless $dh{QUIET} is set. See "Standardization" + above for when this is allowed to be called. complex_doit($command) Pass this function a string that is a shell command, it will run it similarly to how doit() does. You can pass more complicated commands @@ -159,6 +167,9 @@ complex_doit($command) have to worry about things like escaping shell metacharacters. verbose_print($message) Pass this command a string, and it will echo it if $dh{VERBOSE} is set. +nonquiet_print($message) + Pass this command a string, and it will echo it unless $dh{QUIET} is set. + See "Standardization" above for when this is allowed to be called. error($errormsg) Pass this command a string, it will output it to standard error and exit. -- cgit v1.2.3