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 "$FEISTY_MEOW_GENERATED_STORE" -o -z "$TEMPORARIES_PILE" ]; then
31 echo The build whacking script cannot run because either the FEISTY_MEOW_GENERATED_STORE
32 echo variable or the TEMPORARIES_PILE 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 "$FEISTY_MEOW_GENERATED_STORE/clam_tmp" \
41 "$FEISTY_MEOW_GENERATED_STORE/logs" \
42 "$PRODUCTION_STORE/__build_"*.h \
43 "$PRODUCTION_STORE/manifest.txt" \
44 "$RUNTIME_PATH/binaries" \
45 "$RUNTIME_PATH/install" \
46 "$RUNTIME_PATH/waste" \
48 "$PRODUCTION_STORE/clam_bin" \
49 "$PRODUCTION_STORE/binaries" \
50 "$PRODUCTION_STORE/install" \
51 "$PRODUCTION_STORE/logs" \
52 "$PRODUCTION_STORE/waste"
53 # last few mentioning production dir are to clean older code.
55 # echo $(date): " cleaning generated files in source hierarchy..."
57 if [ "$clean_src" == "clean" -o "$clean_src" == "CLEAN" ]; then
58 echo $(date): " ** aggressive cleaning activated..."
60 # get rid of the build binaries.
61 rm -rf "$CLAM_BINARIES"
63 perl "$FEISTY_MEOW_SCRIPTS/files/zapdirs.pl" "$FEISTY_MEOW_APEX" >>"$CRUDFILE"
66 echo $(date): "cleaned [$choprepo]."
73 # clean all known hierarchies of build products...
75 whack_single_build_area "$FEISTY_MEOW_APEX"