diff options
author | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2012-02-24 18:51:14 -0300 |
---|---|---|
committer | Nicolas Reynolds <fauno@kiwwwi.com.ar> | 2012-02-24 18:51:14 -0300 |
commit | ee706c5c36fd8993905a14aa2afeb5951dac6ec9 (patch) | |
tree | 0d23180e1ef13441d82d1427de23963884878e85 /treepkg | |
parent | 2f7e3155e766e552f53dbadab18f4e2aff824cd4 (diff) |
Start from a build tree using `N=true treepkg /path/to/build/dir`
Needs flags :)
Diffstat (limited to 'treepkg')
-rwxr-xr-x | treepkg | 51 |
1 files changed, 28 insertions, 23 deletions
@@ -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 |