moving to a better name than FEISTY_MEOW_GENERATED for chewed scripts folder. too...
[feisty_meow.git] / scripts / generator / whack_build.sh
index 0647b0ab430417f1a8106b98bfca47a0db78dc34..10968823000a8a55095723987d6939fea6efe76d 100644 (file)
@@ -20,30 +20,35 @@ 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")"
+#old  export NEW_TMP="$(mktemp -d "$CLEANING_LOCALE/TEMPS.XXXXXX")"
+  export CRUDFILE="$(mktemp "$TMP/zz_whack_build.XXXXXX")"
   echo "" &>"$CRUDFILE"
 
-  CLEANING_TOP="$CLEANING_LOCALE/production"
+#  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" \
     "$TEMPORARIES_DIR" \
-    "$WASTE_DIR" \
+    "$GENERATED_DIR" \
     "$CLEANING_TOP/__build_"*.h \
-    "$CLEANING_TOP/manifest.txt" 
+    "$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..."
 
@@ -53,7 +58,7 @@ function whack_single_build_area()
   fi
 
   echo $(date): "cleaned [$choprepo]."
-  rm -rf "$NEW_TMP"
+  rm -rf "$CRUDFILE"
   return 0
 }