Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -1,28 +1,25 @@ #! /usr/bin/env bash +# Determine appropriate mode +mode="build" +case "$1" in + clean|distclean|build|retry) + mode="$1" + shift + ;; +esac + +# Determine which Tcl version to build TCLVERS="8.5.14" if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | egrep '^(cvs|fossil)_' >/dev/null; then TCLVERS="$1" shift fi export TCLVERS -# Determine appropriate mode -mode="build" -if [ "$1" = "clean" ]; then - shift - - mode="clean" -fi -if [ "$1" = "distclean" ]; then - shift - - mode="distclean" -fi - # Verify that "pre.sh" has been run if this is a development snapshot of # KitCreator if [ -f 'build/pre.sh' ]; then if ! find 'kitsh/buildsrc/' -name configure -type f 2>/dev/null | grep configure >/dev/null; then echo "Please remember to run 'build/pre.sh' if you expect this build to work." >&2 @@ -29,15 +26,19 @@ fi fi # Define the list of all packages, for cleaning purposes KITCREATOR_ALLPKGS="kitsh tcl tclvfs zlib tk itcl mk4tcl thread dbus" +# Always rebuild kitsh +rm -f "kitsh/.success" for pkg in ${KITCREATOR_ALLPKGS}; do - rm -f "${pkg}/build.log" - rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build" + if [ "${mode}" != "retry" -o ! -f "${pkg}/.success" ]; then + rm -f "${pkg}/build.log" "${pkg}/.success" + rm -rf "${pkg}/out" "${pkg}/inst" "${pkg}/build" - rm -rf "${pkg}/src"/tmp-* + rm -rf "${pkg}/src"/tmp-* + fi if [ "${mode}" = "distclean" ]; then rm -rf "${pkg}/src" fi done @@ -128,18 +129,22 @@ # Do build failedpkgs="" buildfailed="0" for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do - echo -n "Building ${pkg} ..." - failed="0" - ( - cd "${pkg}" >/dev/null 2>/dev/null || exit 1 + if [ -f "${pkg}/.success" ]; then + echo -n "Skipping ${pkg} ..." + else + echo -n "Building ${pkg} ..." + + ( + cd "${pkg}" >/dev/null 2>/dev/null || exit 1 - ./build.sh 3>&1 4>&2 > build.log 2>&1 || exit 1 - ) || failed="1" + ./build.sh 3>&1 4>&2 > build.log 2>&1 || exit 1 + ) || failed="1" + fi if [ "${failed}" = "1" ]; then echo " failed." failedpkgs="${failedpkgs} ${pkg}" else @@ -154,10 +159,12 @@ ;; esac if [ "${failed}" = "1" ]; then buildfailed="1" + else + touch "${pkg}/.success" fi done if [ -n "${failedpkgs}" ]; then echo "Failed to build:${failedpkgs}"