#!/bin/bash clean_src=$1 echo `date`: "Whacking the build's recreatable files..." if [ -z "$REPOSITORY_DIR" ]; then echo "The REPOSITORY_DIR variable is not set!" exit 3 fi export CRUDFILE="$TMP/whack_build_$RANDOM.txt" echo "" >$CRUDFILE export SRC="$REPOSITORY_DIR/source" #hmmm: set an interrupt handler for ctrl-c, to catch a break and send it to # the cleanup of the crudfile. echo `date`: " Cleaning up the build products..." rm -rf \ "$REPOSITORY_DIR/arm_linux_"* \ "$REPOSITORY_DIR/dll" \ "$REPOSITORY_DIR/dll_"* \ "$REPOSITORY_DIR/exe" \ "$REPOSITORY_DIR/exe_"* \ "$REPOSITORY_DIR/include" \ "$REPOSITORY_DIR/install" \ "$REPOSITORY_DIR/lib" \ "$REPOSITORY_DIR/lib_"* \ "$REPOSITORY_DIR/logs" \ "$REPOSITORY_DIR/manifest.txt" \ "$REPOSITORY_DIR/obj" \ "$REPOSITORY_DIR/objects" \ "$REPOSITORY_DIR/pdb" \ "$REPOSITORY_DIR/pdb_"* \ "$REPOSITORY_DIR/tests" \ "$REPOSITORY_DIR/version_report.txt" \ "$REPOSITORY_DIR/waste" \ "$REPOSITORY_DIR/"*_linux_release \ "$REPOSITORY_DIR/"*_linux_debug \ "$REPOSITORY_DIR/"*pack_time.txt \ "$SRC/lib_src/library/__build_"*.h echo `date`: " Cleaning junk out of the source hierarchy..." if [ "$clean_src" == "clean" -o "$clean_src" == "CLEAN" ]; then echo `date`: " ** Aggressive cleaning of generated files in source tree..." perl "$SHELLDIR/zapdirs.pl" "$REPOSITORY_DIR/bin" "$REPOSITORY_DIR/clam" \ "$REPOSITORY_DIR/ide_files" >>"$CRUDFILE" perl "$SHELLDIR/zapdirs.pl" "$SRC" >>"$CRUDFILE" fi echo `date`: "The build has been whacked." rm "$CRUDFILE"