From 4d4439b1b9b5ab83981407e06e3a85bf1144d6cd Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Thu, 9 Jun 2011 20:00:26 -0300 Subject: Changed mipsrelease into a hook that's meant to run for local releases. For mipsrelease, it adds packages to a local repo and copies all needed build files to a dir on WORKDIR. --- fullpkg | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'fullpkg') diff --git a/fullpkg b/fullpkg index 2ca5226..b4475a8 100755 --- a/fullpkg +++ b/fullpkg @@ -257,8 +257,10 @@ function _pkg_build () { 0) plain "The build was succesful." source .INFO && [ -n $repo ] && { -# Release locally - mipsrelease *.pkg.tar.?z + +# Calls a local release script if it's used + [ -z $HOOKLOCALRELEASE ] || \ + $HOOKLOCALRELEASE $repo *.pkg.tar.?z # Stage for releasing librestage $repo || { @@ -268,6 +270,7 @@ function _pkg_build () { msg "Updating pacman db and packages" sudo pacman -Syu --noconfirm } + echo "built:$(basename $PWD)" >> $build_dir/log cleanup "$(basename $PWD)" ;; @@ -313,8 +316,27 @@ function _pkg_build () { popd > /dev/null } + +# End inmediately but print a useful message +trap_exit() { + remove_queue + + error "$@" + warning "Leftover files left on $build_dir" + + exit 1 +} + ## END FUNCTIONS ## +## Trap signals +# From makepkg +set -E +trap 'clean_up' 0 +trap 'trap_exit "TERM signal caught. Exiting..."' TERM HUP QUIT +trap 'trap_exit "Aborted by user! Exiting..."' INT +trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR + force_build="" level=0 noupdate='n' @@ -386,7 +408,7 @@ done } ## if $level = 20 there is highly likely there are circular deps -[ $level -eq $max_level -o $level -gt $max_level ] && exit 20 +[ $level -ge $max_level ] && exit 20 find_deps || { @@ -425,11 +447,12 @@ find_deps || { ## START Building msg "Building packages:" -[ ! -w $queue_file ] && error "can't write queue file" -# Exit loop on Ctrl+C -trap "break" INT -# Remove from queue package being built on error -trap "remove_queue" EXIT INT QUIT TERM KILL +# If the queue file isn't writable go into offline mode +[ ! -w $queue_file ] && { + error "Can't write queue file" + OFFLINE=true +} + _pkg_build echo -- cgit v1.2.2