2
# .COPYRIGHT: Copyright (c) 1988 European Southern Observatory,
6
# .LANGUAGE shell script
7
# .ENVIRONMENT Unix Systems. Executable under SHELL and C-SHELL
10
# .AUTHOR Carlos Guirao
11
# .VERSION 1.1 30-Oct-1989: Implementation.
12
# .VERSION 1.2 05-Dec-1989: Adding "echo" definition
16
if [ "`echo -n`" = "-n" ] ; then
23
# First of all, goto the config directory MID_INSTALL
24
# <dirname> & <basename> commands emulated with <sed>
26
# MIDVERS=`basename $VERSDIR`
27
# MIDASHOME=`dirname $VERSDIR`
29
if [ -z "$MIDASHOME" -o -z "$MIDVERS" ] ; then
30
cd `echo $0 | sed -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'`
32
VERSDIR=`echo $MID_INSTALL | sed 's/\/install\/unix$//'`
33
MIDVERS=`echo $VERSDIR | sed -e 's/^.*\///'`
34
MIDASHOME=`echo $VERSDIR | sed -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'`
36
cd $MIDASHOME/$MIDVERS/install/unix
39
MID_INSTALL=$MIDASHOME/$MIDVERS/install/unix
40
MID_HOME=$MIDASHOME/$MIDVERS
46
# Check weather "ls -s" command returns blocks of 1/2 or 1 kbytes.
47
# The file test_file_1k is 1kbyte big.
48
factor_ls=`ls -s test_file_1k | awk '{print $1}'`
52
echo " DELETE EXECUTABLES FILES FROM:"
55
echo " ========================"
56
for categ in applic stdred contrib gui
58
if [ ! -d $MID_HOME/$categ ]; then
62
for pack in `ls | egrep -v 'lib|exec|proc'`
64
if [ -f $pack/src/makefile ] ; then
71
echo "Type <Q> to quit or <L> to list again."
74
$echo "Select NAME to DELETE: " $SV_NONL
76
if [ "$name" = "q" -o "$name" = "Q" ] ; then
79
if [ "$name" = "l" -o "$name" = "L" ] ; then
82
if [ "$name" = "" ] ; then
85
if [ -f $MID_HOME/applic/$name/src/makefile ] ; then
87
elif [ -f $MID_HOME/stdred/$name/src/makefile ] ; then
89
elif [ -f $MID_HOME/contrib/$name/src/makefile ] ; then
91
elif [ -f $MID_HOME/gui/$name/src/makefile ] ; then
94
echo "$name: No such package with that name"
98
$echo "Number of kbytes to be deleted: (wait) " $SV_NONL
99
cd $MID_HOME/$categ/$name/src
100
ls -s `make -n clean_exec | sed -e 's/^rm//' -e 's/-f//'` 2>/dev/null | \
101
awk -f $MID_INSTALL/size.awk factor=$factor_ls
102
if [ $? != 0 ] ; then
105
$echo "Do you want to delete $name executables [yn]? (y): " $SV_NONL
107
if [ -z "$answ" ]; then
110
if [ "$answ" != "y" -a "$answ" != "Y" ]; then