3 #hmmm: nice to set an interrupt handler for ctrl-c, to catch a break and send it to the cleanup of the crudfile.
5 # catch whether they want rigorous cleaning or not.
8 function whack_single_build_area()
10 local CLEANING_LOCALE="$1"; shift
11 if [ ! -d "$CLEANING_LOCALE" ]; then
12 # echo "the folder $CLEANING_LOCALE does not exist. not cleaning."
16 local choprepo="$(basename "$(dirname "$CLEANING_LOCALE")" )/$(basename "$CLEANING_LOCALE")"
17 echo $(date): "cleaning up [$choprepo]..."
18 if [ -z "$CLEANING_LOCALE" ]; then
19 echo "The CLEANING_LOCALE variable is not set!"
23 export NEW_TMP="$(mktemp -d "$CLEANING_LOCALE/TEMPS.XXXXXX")"
24 export CRUDFILE="$(mktemp "$NEW_TMP/whack_build.XXXXXX")"
27 CLEANING_TOP="$CLEANING_LOCALE/production"
29 # echo $(date): " cleaning up the build products..."
31 # avoid accidentally removing way too much important stuff if our variables have not
32 # been previously established.
33 local WASTE_DIR="$CLEANING_TOP/waste"
34 local TEMPORARIES_DIR="$CLEANING_TOP/temporaries"
38 "$FEISTY_MEOW_DIR/generatedJUnitFiles" \
39 "$CLEANING_TOP/binaries" \
40 "$CLEANING_TOP/install" \
41 "$CLEANING_TOP/logs" \
42 "$CLEANING_TOP/objects" \
45 "$CLEANING_TOP/__build_"*.h \
46 "$CLEANING_TOP/manifest.txt"
48 # echo $(date): " cleaning generated files in source hierarchy..."
50 if [ "$clean_src" == "clean" -o "$clean_src" == "CLEAN" ]; then
51 echo $(date): " ** aggressive cleaning activated..."
52 perl "$FEISTY_MEOW_SCRIPTS/files/zapdirs.pl" "$FEISTY_MEOW_DIR" >>"$CRUDFILE"
55 echo $(date): "cleaned [$choprepo]."
62 # clean all known hierarchies of build products...
64 whack_single_build_area "$FEISTY_MEOW_DIR"