diff options
Diffstat (limited to 'treepkg')
-rwxr-xr-x | treepkg | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -1,9 +1,12 @@ #!/bin/bash #set -x source /etc/libretools.conf -source $(dirname $0)/libremessages source $XDG_CONFIG_HOME/libretools/libretools.conf >/dev/null 2>&1|| true +# Get system variables +source /etc/makepkg.conf +source $HOME/makepkg.conf >/dev/null 2>&1|| true + # End inmediately but print a useful message trap_exit() { error "($(basename $0)) $@" @@ -32,7 +35,7 @@ get_fullver() { # $1 status # $2 pkgname add_order() { - echo "${1};${DEPTH};${2:-${pkgbase}};${fullver};${PWD}" >> "${BUILDORDER}" + echo "${1};${DEPTH};${2:-${pkgbase}};${fullver};${PWD};$(guess_repo "$PWD")" >> "${BUILDORDER}" ${VERBOSE} && msg2 "%${DEPTH}s${2:-${pkgbase}} [${1}]" || true } @@ -44,8 +47,14 @@ where_is() { cut -d: -f2 2>/dev/null } +# Guess the repo from the pkgbase path +# $1 path, pwd or where_is +guess_repo() { + basename "$(dirname "${1}")" +} + if [ ! -f PKGBUILD ]; then - error "Missing PKGBUILD" + error "Missing PKGBUILD ($PWD)" exit 1 fi @@ -148,7 +157,8 @@ if [ ${DEPTH} -eq 0 ]; then # Run build command pushd "${BUILDDIR}/${_pkg}" >/dev/null ${FULLBUILDCMD} - ${HOOKLOCALRELEASE} +# Run local release hook with $1 = $repo + ${HOOKLOCALRELEASE} $(egrep ";${_pkg};" "${BUILDORDER}" | cut -d';' -f6) popd >/dev/null done |