From 64b427c2449eb45ec945afd09cced57c8a7d7e4e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 10:53:45 -0500 Subject: treepkg: make HOOK* settings optional, update documentation on the HOOK*s --- src/treepkg | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/treepkg') diff --git a/src/treepkg b/src/treepkg index bfe2163..4dc29dc 100755 --- a/src/treepkg +++ b/src/treepkg @@ -19,7 +19,9 @@ source libremessages source $(librelib conf.sh) load_files libretools -check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE || exit 1 +check_vars libretools FULLBUILDCMD || exit 1 +# The following variables are actually optional +#check_vars libretools HOOKPREBUILD HOOKLOCALRELEASE || exit 1 load_files makepkg term_title "${0##*/}" @@ -205,11 +207,16 @@ if [[ ${DEPTH} -eq 0 ]]; then pushd "${BUILDDIR}/${_pkg}" >/dev/null sudo -E pacman -Syu --noconfirm - ${HOOKPREBUILD} + if [[ -n "${HOOKPREBUILD:-}" ]]; then + ${HOOKPREBUILD} + fi ${FULLBUILDCMD} + # Run local release hook with $1 = $repo - ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) + if [[ -n "${HOOKLOCALRELEASE:-}" ]]; then + ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) + fi touch built_ok popd >/dev/null -- cgit v1.2.2