Skip to content

Commit

Permalink
Add debug tracing
Browse files Browse the repository at this point in the history
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!?
  • Loading branch information
me-and committed Oct 30, 2023
1 parent 27dd0cc commit ec49e7a
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions taskwarrior.cygport
Original file line number Diff line number Diff line change
Expand Up @@ -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\:-

0 comments on commit ec49e7a

Please sign in to comment.