summaryrefslogtreecommitdiff
path: root/fullpkg
diff options
context:
space:
mode:
Diffstat (limited to 'fullpkg')
-rwxr-xr-xfullpkg39
1 files changed, 31 insertions, 8 deletions
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