From ec49e7a0506e7dd586db6d55eef9b98e593bf0f9 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Mon, 30 Oct 2023 10:31:55 +0000 Subject: [PATCH] Add debug tracing I expected the fish script install steps that failed to cause the install step as a whole to fail, but that didn't happen. Why!? --- taskwarrior.cygport | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/taskwarrior.cygport b/taskwarrior.cygport index 0cc278b..d66b970 100644 --- a/taskwarrior.cygport +++ b/taskwarrior.cygport @@ -33,31 +33,45 @@ src_test () { ./problems } +vverbose () { + local msg rc + printf -v msg '%q ' "$@" + inform "${msg::-1}" + rc=0 + "${@}" || rc="$?" + printf -v msg '%s returns %d\n' "${cmd[0]}" "$rc" + inform "$msg" + return "$rc" +} + src_install () { - cd "$B" - cyginstall + inform "${BASHOPTS@Q} / ${BASH_LINENO[@]@Q} / ${BASH_SOURCE[@]@Q} / ${FUNCNAME[@]@Q} / ${LINENO} / ${PIPESTATUS[@]@Q}" + vverbose cd "$B" + vverbose cyginstall # The taskwarrior installer puts actually useful completion and Vim # scripts in the documentation folder. Put those somewhere more # useful. - cd "$D" + vverbose cd "$D" + vverbose pkg-config --variable=completionsdir bash-completion bash_completions_dir="$(pkg-config --variable=completionsdir bash-completion)" bash_completions_dir="${bash_completions_dir#/}" - mkdir -p "$bash_completions_dir" - mv usr/share/doc/taskwarrior/scripts/bash/task.sh "$bash_completions_dir"/task + vverbose mkdir -p "$bash_completions_dir" + vverbose mv usr/share/doc/taskwarrior/scripts/bash/task.sh "$bash_completions_dir"/task + vverbose pkg-config --variable=completionsdir fish fish_completions_dir="$(pkg-config --variable=completionsdir fish)" fish_completions_dir="${fish_completions_dir#/}" - mkdir -p "$fish_completions_dir" - mv usr/share/doc/scripts/fish/task.fish "$fish_completions_dir" + vverbose mkdir -p "$fish_completions_dir" + vverbose mv usr/share/doc/scripts/fish/task.fish "$fish_completions_dir" # Seems like there should be a better option than hard-coding this # path, but I couldn't trivially find one. vim_config_dir=usr/share/vim/vimfiles - mkdir -p "$vim_config_dir" - mv usr/share/doc/taskwarrior/scripts/vim/{ftdetect,syntax} "$vim_config_dir" - mv usr/share/doc/taskwarrior/scripts/vim/README usr/share/doc/taskwarrior/vim.README + vverbose mkdir -p "$vim_config_dir" + vverbose mv usr/share/doc/taskwarrior/scripts/vim/{ftdetect,syntax} "$vim_config_dir" + vverbose mv usr/share/doc/taskwarrior/scripts/vim/README usr/share/doc/taskwarrior/vim.README } # vim: set noexpandtab tabstop=8 listchars=tab\:\ \ ,trail\:-,lead\:-