1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
#! /bin/sh
# @(#)cleanmidas.sh 19.1 (ESO-IPG) 02/25/03 14:31:58
#
# cleanrelease procedure
# remove all dependent files
# .VERSION 1.1 04 Nov 88 - C. Guirao [ESO-IPG]
# Determine how to set prompt
if [ "`echo -n a`" = a ]; then
# BSD echo
NNN=-n
CCC=
else
# USG echo
NNN=
CCC='\c'
fi
necho()
{
#
# A safe way to perform echo without sending a new-line
#
echo $NNN "$*" $CCC > /dev/tty
}
ask_yn()
{
#
# Get a yes/no answer from the user; $1 is the prompt, $2 the default
#
prompt="$1"
def="${2:-y}" # yes is the default if not supplied
while true; do
necho "$prompt [$def]: "
read answer
answer="${answer:-$def}"
case "$answer" in
[yY])
answer=y
break
;;
[nN])
answer=n
break
;;
*)
error Please enter "'y'" or "'n'".
;;
esac
done
[ $answer = y ]
}
MID_HERE=`pwd`
if [ -z "$MIDVERS" ] ; then
MIDVERS=`echo $MID_HERE | sed 's/^.*midas\/\([^\/]*\).*$/\1/'`
fi
if [ -z "$MIDASHOME" ] ; then
MIDASHOME=`echo $MID_HERE | sed 's/\/'$MIDVERS'.*$//'`
fi
MID_HOME=$MIDASHOME/$MIDVERS
export MIDASHOME MIDVERS
if ask_yn "REMOVING DEPENDENT FILES UNDER $MIDASHOME/$MIDVERS"; then
echo ""
else
exit 0
fi
cd $MIDASHOME/$MIDVERS
echo "rm -rf install/vms install/unix/test install/unix/systems"
rm -rf install/vms install/unix/test install/unix/systems
echo "rm -rf local/shlib local/preinstall local/setup local/README"
rm -rf local/util local/shlib local/preinstall local/setup local/README
echo "rm -rf test tmp contrib/lib"
rm -rf test tmp contrib/lib
echo "rm -rf util/bdf2ps util/help util/libsrc util/ltape util/tapeserv"
rm -rf util/bdf2ps util/help util/libsrc util/ltape util/tapeserv
echo "rm -rf pipeline"
echo "mkdir pipeline"
echo "chmod 775 pipeline"
echo "touch pipeline/EMPTY"
rm -rf pipeline
mkdir pipeline
chmod 775 pipeline
touch pipeline/EMPTY
echo "rm -f *.o *.for *.tex *.mar *.fc *.doc *.csh *.com *.f *.c"
echo "rm -f SELECTED DEPENDENCIES"
find . \( \
-name "*.o" -o \
-name "*.for" -o \
-name "*.tex" -o \
-name "*.mar" -o \
-name "*.fc" -o \
-name "*.doc" -o \
-name "*.csh" -o \
-name "*.com" -o \
-name "*.lasc" -o \
-name "*.iasc" -o \
-name "*.f" -o \
-name "SELECTED" -o \
-name "DEPENDENCIES" -o \
-name "*.c" \) -exec rm -f {} \;
cd $MIDASHOME/$MIDVERS/system/exec
echo "rm -f computer.exe ftoc_fx.exe ftoc_hp* ftoc_osf.exe"
rm -f computer.exe ftoc_fx.exe ftoc_hp* ftoc_osf.exe
echo "rm -f ftoc_pc.exe ftoc_sun.exe ftoc_titan.exe fontsup.exe"
rm -f ftoc_pc.exe ftoc_sun.exe ftoc_titan.exe fontsup.exe
cd $MIDASHOME/$MIDVERS
echo "rm -rf ./gui/GraphLib ./gui/incl ./gui/lib/*.a"
rm -rf ./gui/GraphLib ./gui/incl ./gui/lib/*.a
cd $MIDASHOME/$MIDVERS/lib
# Libraries included in libmidas.a and libgmidas.a
# For 95NOV also: rm -f libdio.a libdsp.a
rm -f libos.a libftoc.a libst.a libtbl.a libidicl.a libagl3.a libplot.a
#
rm -f libreadline.a libmath.a libtw.a libtw3.a ../monit/libprep.a
#
# Libraries from applic
#rm -f libfit.a libfituser.a libagen.a libaplot.a libstat.a
|