pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

commit 82c4755a063edf3f2347cb2ca92266d24ff8e12a
parent e9e0aa04b65eea4b9d770f5fbb6237ceccd47092
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Fri,  9 May 2025 16:19:37 +0000

Make debug output conditional

Diffstat:
Mcommand/pthbs-makegen | 8++++++--
Mutil/_verify-external-resources.awk | 8++++++--
2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/command/pthbs-makegen b/command/pthbs-makegen @@ -34,13 +34,17 @@ exec env \ BEGIN { downloadlist_path=ENVIRON["pthbs_indexdir"]"/downloadlist.sha256" filelist_path=ENVIRON["pthbs_indexdir"]"/filelist.sha256" - printf "DBG: reading downloadlist: %s\n", downloadlist_path >"/dev/stderr" + if(length(ENVIRON["pthbs_debug"])) { + printf "DBG: reading downloadlist: %s\n", downloadlist_path >"/dev/stderr" + } while(getline <downloadlist_path) { downloadable_hashes["sha256",$1] = 1 } close(downloadlist_path) - printf "DBG: reading filelist: %s\n", filelist_path >"/dev/stderr" + if(length(ENVIRON["pthbs_debug"])) { + printf "DBG: reading filelist: %s\n", filelist_path >"/dev/stderr" + } while(getline <filelist_path) { linkable_hashes["sha256",$1] = 1 } diff --git a/util/_verify-external-resources.awk b/util/_verify-external-resources.awk @@ -24,10 +24,14 @@ function q(s) { return "'" s "'" } function dbgprint(msg) { - printf "DBG: %s\n", msg >"/dev/stderr" + if(length(ENVIRON["pthbs_debug"])) { + printf "DBG: %s\n", msg >"/dev/stderr" + } } function dbgprint_count(n) { - printf "DBG: %d entries\n", n >"/dev/stderr" + if(length(ENVIRON["pthbs_debug"])) { + printf "DBG: %d entries\n", n >"/dev/stderr" + } } function dbgprint_dep(dep_type, dep_value) { dbgprint(pfile" -> ["dep_type"]"dep_value)