summaryrefslogtreecommitdiff
path: root/treepkg
diff options
context:
space:
mode:
Diffstat (limited to 'treepkg')
-rwxr-xr-xtreepkg51
1 files changed, 28 insertions, 23 deletions
diff --git a/treepkg b/treepkg
index a49301e..e742858 100755
--- a/treepkg
+++ b/treepkg
@@ -114,34 +114,37 @@ NEXTDEPTH=$((${DEPTH} + 1))
VERBOSE=${V:-true}
BUILD=${B:-true}
CLEANUP=${C:-true}
+# Skip BUILDORDER creation and build anything on BUILDDIR
+BUILDNOW=${N:-false}
+if ! ${BUILDNOW}; then
# ensure it exists
-touch "${BUILDORDER}"
+ touch "${BUILDORDER}"
# If this package is already built quit silently
-if is_built "${pkgbase}" "${fullver}"; then
- add_order "ignore"
- exit 0
-fi
+ if is_built "${pkgbase}" "${fullver}"; then
+ add_order "ignore"
+ exit 0
+ fi
# Ignore if already in build order
-egrep -q ";${pkgbase};" "${BUILDORDER}" && exit 0
+ egrep -q ";${pkgbase};" "${BUILDORDER}" && exit 0
# Add pkgbase to build order
-add_order "build"
+ add_order "build"
# Copy the directory to the build dir
# TODO run makepkg --source to avoid moving garbage around?
-cp -r "${PWD}" "${BUILDDIR}/$(printf "%03d" ${DEPTH})_${pkgbase}"
+ cp -r "${PWD}" "${BUILDDIR}/$(printf "%03d" ${DEPTH})_${pkgbase}"
# Cleanup dep versioning
-deps=($(echo "${depends[@]} ${makedepends[@]}" | \
- sed "s/[=<>]\+[^ ]\+//g" | \
- tr ' ' "\n" | \
- sort -u))
+ deps=($(echo "${depends[@]} ${makedepends[@]}" | \
+ sed "s/[=<>]\+[^ ]\+//g" | \
+ tr ' ' "\n" | \
+ sort -u))
# NOTE: getting depends from package() is a PITA
-for _dep in ${deps[@]}; do
+ for _dep in ${deps[@]}; do
# Ignore if already in build order
# TODO move deps deeper in the tree if
# pkgbase - dep1
@@ -149,24 +152,26 @@ for _dep in ${deps[@]}; do
# dep1 should be depth + 1
# probably sed -i buildorder and increase dep's dep depth :D
# remember to change dir name from xxx_pkgbase to xxx+1_pkgbase
- egrep -q ";${_dep};" "${BUILDORDER}" && bury "${_dep}" ${NEXTDEPTH}
+ egrep -q ";${_dep};" "${BUILDORDER}" && bury "${_dep}" ${NEXTDEPTH}
# Ask toru where's a PKGBUILD
- depdir="$(where_is ${_dep})"
+ depdir="$(where_is ${_dep})"
- if [ -z "${depdir}" -o ! -d "${depdir}" ]; then
+ if [ -z "${depdir}" -o ! -d "${depdir}" ]; then
# We specify the pkgname because we can't source the dep PKGBUILD
# Normally 'any' packages are missing from our work ABS
- add_order "missing" "${_dep}"
- continue
- fi
+ add_order "missing" "${_dep}"
+ continue
+ fi
- pushd "${depdir}" >/dev/null
+ pushd "${depdir}" >/dev/null
# Run itself over dependencies
- $0 "${BUILDDIR}" ${NEXTDEPTH}
+ $0 "${BUILDDIR}" ${NEXTDEPTH}
-done
+ done
+# End BUILD now
+fi
# Only build at the end
if [ ${DEPTH} -eq 0 ]; then
@@ -198,7 +203,7 @@ if [ ${DEPTH} -eq 0 ]; then
${VERBOSE} || echo "${BUILDORDER}" || true
fi
-if (( CLEANUP )); then
+if ${CLEANUP} ; then
msg2 "Removing ${BUILDDIR}"
rm -rf "${BUILDDIR}"
fi