X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fgenerator%2Fwhack_build.sh;h=f0830a94b92c5f148f71bc00b24a9f7ada2088a3;hb=2f66db56b3c178132bb9d8f595c890bb6fdb6a28;hp=0778fb6da08ef9bf1c4339d82ceb8c2c5cafc33c;hpb=068a293d75c9b3bfe11489d062a7d20a6be9ddaa;p=feisty_meow.git diff --git a/scripts/generator/whack_build.sh b/scripts/generator/whack_build.sh index 0778fb6d..f0830a94 100644 --- a/scripts/generator/whack_build.sh +++ b/scripts/generator/whack_build.sh @@ -20,40 +20,46 @@ function whack_single_build_area() exit 3 fi - export NEW_TMP="$(mktemp -d "$CLEANING_LOCALE/TEMPS.XXXXXX")" - export CRUDFILE="$(mktemp "$NEW_TMP/whack_build.XXXXXX")" + export CRUDFILE="$(mktemp "$TMP/zz_whack_build.XXXXXX")" echo "" &>"$CRUDFILE" - CLEANING_TOP="$CLEANING_LOCALE/production" - # echo $(date): " cleaning up the build products..." - # avoid accidentally removing way too much important stuff if our variables have not - # been previously established. - local WASTE_DIR="$CLEANING_TOP/waste" - local TEMPORARIES_DIR="$CLEANING_TOP/temporaries" + # avoid accidentally removing important stuff if our variables have not been previously + # established. + if [ -z "$GENERATED_DIR" -o -z "$TEMPORARIES_DIR" ]; then + echo The build whacking script cannot run because either the GENERATED_DIR + echo variable or the TEMPORARIES_DIR variable have not been set. This makes + echo it unsafe to remove anything in the build products. + exit 1 + fi - # kerzap. + # kerzap. the cleanups in production directory remove older locations of generated files. rm -rf \ - "$FEISTY_MEOW_DIR/generatedJUnitFiles" \ - "$CLEANING_TOP/binaries" \ - "$CLEANING_TOP/install" \ - "$CLEANING_TOP/logs" \ - "$CLEANING_TOP/objects" \ + "$FEISTY_MEOW_APEX/generatedJUnitFiles" \ + "$GENERATED_DIR/clam_tmp" \ + "$GENERATED_DIR/logs" \ + "$PRODUCTION_DIR/__build_"*.h \ + "$PRODUCTION_DIR/manifest.txt" \ + "$RUNTIME_DIR/binaries" \ + "$RUNTIME_DIR/install" \ + "$RUNTIME_DIR/waste" \ "$TEMPORARIES_DIR" \ - "$WASTE_DIR" \ - "$CLEANING_TOP/__build_"*.h \ - "$CLEANING_TOP/manifest.txt" + "$PRODUCTION_DIR/clam_bin" \ + "$PRODUCTION_DIR/binaries" \ + "$PRODUCTION_DIR/install" \ + "$PRODUCTION_DIR/logs" \ + "$PRODUCTION_DIR/waste" # echo $(date): " cleaning generated files in source hierarchy..." if [ "$clean_src" == "clean" -o "$clean_src" == "CLEAN" ]; then echo $(date): " ** aggressive cleaning activated..." - perl "$FEISTY_MEOW_DIR/scripts/files/zapdirs.pl" "$FEISTY_MEOW_DIR" >>"$CRUDFILE" + perl "$FEISTY_MEOW_SCRIPTS/files/zapdirs.pl" "$FEISTY_MEOW_APEX" >>"$CRUDFILE" fi echo $(date): "cleaned [$choprepo]." - rm -rf "$NEW_TMP" + rm -rf "$CRUDFILE" return 0 } @@ -61,5 +67,5 @@ function whack_single_build_area() # clean all known hierarchies of build products... -whack_single_build_area "$FEISTY_MEOW_DIR" +whack_single_build_area "$FEISTY_MEOW_APEX"