X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fgenerator%2Fwhack_build.sh;h=b050ca380275cffaccbdb8b09acba400b8d59ad9;hb=9ebae4831763d4c2851286f7fea265c27bd500e5;hp=a9dc095ffa41e17b9cd4892d2e307439a09ea131;hpb=3ea085ec301ed1399dfa1e9f3a240312dc95410b;p=feisty_meow.git diff --git a/scripts/generator/whack_build.sh b/scripts/generator/whack_build.sh index a9dc095f..b050ca38 100644 --- a/scripts/generator/whack_build.sh +++ b/scripts/generator/whack_build.sh @@ -14,46 +14,57 @@ function whack_single_build_area() fi local choprepo="$(basename "$(dirname "$CLEANING_LOCALE")" )/$(basename "$CLEANING_LOCALE")" - echo $(date): "Cleaning up [$choprepo]..." + echo $(date): "cleaning up [$choprepo]..." if [ -z "$CLEANING_LOCALE" ]; then echo "The CLEANING_LOCALE variable is not set!" 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..." -# 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 "$FEISTY_MEOW_GENERATED_STORE" -o -z "$TEMPORARIES_PILE" ]; then + echo The build whacking script cannot run because either the FEISTY_MEOW_GENERATED_STORE + echo variable or the TEMPORARIES_PILE 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" \ - "$TEMPORARIES_DIR" \ - "$WASTE_DIR" \ - "$CLEANING_TOP/__build_"*.h \ - "$CLEANING_TOP/manifest.txt" - -# echo $(date): " Cleaning generated files in source hierarchy..." + "$FEISTY_MEOW_APEX/generatedJUnitFiles" \ + "$FEISTY_MEOW_GENERATED_STORE/clam_tmp" \ + "$FEISTY_MEOW_GENERATED_STORE/logs" \ + "$PRODUCTION_STORE/__build_"*.h \ + "$PRODUCTION_STORE/manifest.txt" \ + "$RUNTIME_PATH/binaries" \ + "$RUNTIME_PATH/install" \ + "$RUNTIME_PATH/waste" \ + "$TEMPORARIES_PILE" \ + "$PRODUCTION_STORE/clam_bin" \ + "$PRODUCTION_STORE/binaries" \ + "$PRODUCTION_STORE/install" \ + "$PRODUCTION_STORE/logs" \ + "$PRODUCTION_STORE/waste" +# last few mentioning production dir are to clean older code. + +# 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" "$CLEANING_TOP" >>"$CRUDFILE" + echo $(date): " ** aggressive cleaning activated..." + + # get rid of the build binaries. + rm -rf "$CLAM_BINARIES" + + perl "$FEISTY_MEOW_SCRIPTS/files/zapdirs.pl" "$FEISTY_MEOW_APEX" >>"$CRUDFILE" fi - echo $(date): "Cleaned [$choprepo]." - rm -rf "$NEW_TMP" + echo $(date): "cleaned [$choprepo]." + rm -rf "$CRUDFILE" return 0 } @@ -61,5 +72,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"