diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-03 02:16:44 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-03 02:16:44 -0500 |
commit | 52cc0c3ff27d4c48d3461d9fd898367aa4a92631 (patch) | |
tree | f4d2b4fcfbc1c6cda116b7723ebe2eee774b0cd6 /src/treepkg | |
parent | 3793e4fac9d1d853251e84838caa2b8849d1f32b (diff) | |
parent | 58e2a9cd5aa9a4eb80f8da675685f62aca128eb3 (diff) |
Merge branch 'master' into xbs
Conflicts:
src/lib/conf.sh
Diffstat (limited to 'src/treepkg')
-rwxr-xr-x | src/treepkg | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/treepkg b/src/treepkg index 5c1312d..e509dac 100755 --- a/src/treepkg +++ b/src/treepkg @@ -19,15 +19,15 @@ source libremessages source $(librelib conf.sh) load_files libretools -check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE +check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE || exit 1 load_files makepkg term_title "$(basename $0)" # End inmediately but print an useful message trap_exit() { - term_title "error!" - error "($(basename $0)) $@ (leftovers on ${BUILDDIR})" + term_title "${0##*/}: $(_ 'Error!')" + error "%s: %s (leftovers on %s" "${0##*/}" "$*" "${BUILDDIR}" exit 1 } @@ -59,10 +59,10 @@ bury() { # If there's a depth or the package is not the root of the build tree (which # can lead to funny chicken-and-egg problems), update the depth to the current # package next-depth and rename the dir too - if [ -z "${current_depth}" ]; then return; fi - if [ -z "${current_name}" ]; then return; fi - if [ ${current_depth} -eq 0 ]; then return; fi - if [ ${current_depth} -ge $2 ]; then return; fi + if [[ -z "${current_depth}" ]]; then return; fi + if [[ -z "${current_name}" ]]; then return; fi + if [[ ${current_depth} -eq 0 ]]; then return; fi + if [[ ${current_depth} -ge $2 ]]; then return; fi ${VERBOSE} && msg "Burying ${1} from ${current_depth} to ${2}" @@ -78,8 +78,8 @@ guess_repo() { basename "$(dirname "${1}")" } -if [ ! -f PKGBUILD ]; then - error "Missing PKGBUILD ($PWD)" +if [[ ! -f PKGBUILD ]]; then + error "Missing PKGBUILD (%s)" "$PWD" exit 1 fi @@ -103,7 +103,7 @@ done pkgbase="${pkgbase:-${pkgname[0]}}" # Get or set the work dir -BUILDDIR="${1:-$(mktemp -d /tmp/${pkgbase}-treepkg-XXXx)}" +BUILDDIR="${1:-$(mktemp --tmpdir -d ${pkgbase}-treepkg.XXXXXXXXXX)}" BUILDORDER="${BUILDDIR}/BUILDORDER" DEPTH=${2:-0} NEXTDEPTH=$((${DEPTH} + 1)) @@ -175,21 +175,21 @@ if ! ${BUILDNOW}; then fi # Only build at the end -if [ ${DEPTH} -eq 0 ]; then +if [[ ${DEPTH} -eq 0 ]]; then ${VERBOSE} && msg "Starting build" || true if ${BUILD}; then - ${VERBOSE} && msg "Build tree stored in ${BUILDORDER}" || true + ${VERBOSE} && msg "Build tree stored in %s" "${BUILDORDER}" || true # Build everything sorting the build dir # The reverse order ensures we start by the deepest packages for _pkg in $(ls -r "${BUILDDIR}"); do # Ignore if there's no PKGBUILD - if [ ! -f "${BUILDDIR}/${_pkg}/PKGBUILD" ]; then continue; fi + if [[ ! -f "${BUILDDIR}/${_pkg}/PKGBUILD" ]]; then continue; fi # Skip if already built (faster than calling is_build again) - if [ -f "${BUILDDIR}/${_pkg}/built_ok" ]; then continue; fi + if [[ -f "${BUILDDIR}/${_pkg}/built_ok" ]]; then continue; fi - ${VERBOSE} && msg "Building ${_pkg/_/ }" || true + ${VERBOSE} && msg "Building %s" "${_pkg/_/ }" || true # Remove leading zeros and space if any term_title "$(echo ${_pkg/_/ } | sed "s/^0\+ \?//")" @@ -214,11 +214,11 @@ if [ ${DEPTH} -eq 0 ]; then fi if ${CLEANUP} ; then - msg2 "Removing ${BUILDDIR}" + msg2 "Removing %s" "${BUILDDIR}" rm -rf "${BUILDDIR}" fi fi -term_title "done" +term_title "$(_ Done)" exit $? |