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 CRUDFILE="$(mktemp "$TMP/zz_whack_build.XXXXXX")"
26 # echo $(date): " cleaning up the build products..."
28 # avoid accidentally removing important stuff if our variables have not been previously
30 if [ -z "$GENERATED_DIR" -o -z "$TEMPORARIES_DIR" ]; then
31 echo The build whacking script cannot run because either the GENERATED_DIR
32 echo variable or the TEMPORARIES_DIR variable have not been set. This makes
33 echo it unsafe to remove anything in the build products.
37 # kerzap. the cleanups in production directory remove older locations of generated files.
39 "$FEISTY_MEOW_APEX/generatedJUnitFiles" \
40 "$GENERATED_DIR/clam_tmp" \
41 "$GENERATED_DIR/logs" \
42 "$PRODUCTION_DIR/__build_"*.h \
43 "$PRODUCTION_DIR/manifest.txt" \
44 "$RUNTIME_DIR/binaries" \
45 "$RUNTIME_DIR/install" \
46 "$RUNTIME_DIR/waste" \
48 "$PRODUCTION_DIR/clam_bin" \
49 "$PRODUCTION_DIR/binaries" \
50 "$PRODUCTION_DIR/install" \
51 "$PRODUCTION_DIR/logs" \
52 "$PRODUCTION_DIR/waste"
54 # echo $(date): " cleaning generated files in source hierarchy..."
56 if [ "$clean_src" == "clean" -o "$clean_src" == "CLEAN" ]; then
57 echo $(date): " ** aggressive cleaning activated..."
58 perl "$FEISTY_MEOW_SCRIPTS/files/zapdirs.pl" "$FEISTY_MEOW_APEX" >>"$CRUDFILE"
61 echo $(date): "cleaned [$choprepo]."
68 # clean all known hierarchies of build products...
70 whack_single_build_area "$FEISTY_MEOW_APEX"