summaryrefslogtreecommitdiff
path: root/src/treepkg
diff options
context:
space:
mode:
Diffstat (limited to 'src/treepkg')
-rwxr-xr-xsrc/treepkg29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/treepkg b/src/treepkg
index e509dac..9d3c0c3 100755
--- a/src/treepkg
+++ b/src/treepkg
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
-#set -x
-# (c) 2012 Nicolás Reynolds <fauno@parabola.nu>
+
+# Copyright (C) 2012-2013 Nicolás Reynolds <fauno@parabola.nu>
+# Copyright (C) 2013 Luke Shumaker <lukeshu@sbcglobal.net>
+#
+# License: GNU GPLv3+
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,10 +22,12 @@ 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 "$(basename $0)"
+term_title "${0##*/}"
# End inmediately but print an useful message
trap_exit() {
@@ -114,6 +119,7 @@ BUILD=${B:-true}
CLEANUP=${C:-true}
# Skip BUILDORDER creation and build anything on BUILDDIR
BUILDNOW=${N:-false}
+IGNORE=(${I})
if [[ ! -z $1 ]] && [[ $DEPTH -eq 0 ]]; then
BUILDNOW=true
@@ -125,6 +131,12 @@ if ! ${BUILDNOW}; then
# If this package is already built quit silently
for _pkg in "${pkgname[@]}"; do
+
+ if in_array "${_pkg}" "${IGNORE[@]}"; then
+ add_order "ignore"
+ exit 0
+ fi
+
if is_built "${_pkg}" "$(get_full_version ${_pkg})"; then
add_order "ignore"
exit 0
@@ -198,11 +210,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