Debian Codegraph @

install/unix/list

raw symbols SCIP
1 #! /bin/sh
2 # @(#)list.sh 19.1 (ESO-IPG) 02/25/03 13:51:11
3 # .COPYRIGHT: Copyright (c) 1988 European Southern Observatory,
4 # all rights reserved
5 # .TYPE command
6 # .NAME list.sh
7 # .LANGUAGE shell script
8 # .ENVIRONMENT Unix Systems. Executable under SHELL and C-SHELL
9 # .COMMENTS
10 # Usage:
11 #
12 # .AUTHOR Carlos Guirao
13 # .VERSION 2.2 14-Oct-1988: Cosmetic changes
14 # .VERSION 2.3 05-Dec-1989: Adding "echo" definition
15
16 echo=echo
17 if [ "`echo -n`" = "-n" ] ; then
18 SV_NONL="\c"
19 else
20 echo="echo -n"
21 fi
22
23 #
24 # First of all, goto the config directory MID_INSTALL
25 # <dirname> & <basename> commands emulated with <sed>
26 # cd `dirname $0`
27 # MIDVERS=`basename $VERSDIR`
28 # MIDASHOME=`dirname $VERSDIR`
29 #
30 if [ -z "$MIDASHOME" -o -z "$MIDVERS" ] ; then
31 cd `echo $0 | sed -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'`
32 MID_INSTALL=`pwd`
33 VERSDIR=`echo $MID_INSTALL | sed 's/\/install\/unix$//'`
34 MIDVERS=`echo $VERSDIR | sed -e 's/^.*\///'`
35 MIDASHOME=`echo $VERSDIR | sed -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'`
36 else
37 cd $MIDASHOME/$MIDVERS/install/unix
38 fi
39
40 MID_INSTALL=$MIDASHOME/$MIDVERS/install/unix
41 MID_HOME=$MIDASHOME/$MIDVERS
42
43 clear
44 while : ; do
45 (echo ""
46 echo " LIST OF AVAILABLE PACKAGES FOR MIDAS:"
47 echo ""
48 echo " Name Category Status"
49 echo " ========================================"
50 for categ in applic stdred contrib gui
51 do
52 if [ ! -d $MID_HOME/$categ ]; then
53 continue
54 fi
55 cd $MID_HOME/$categ
56 for pack in `ls | grep -E -v 'lib|exec|proc'`
57 do
58 if [ -f $pack/src/makefile -o \
59 -f $pack/libsrc/makefile -o \
60 -f $pack/etc/makefile -o \
61 -f $pack/proc/makefile ] ; then
62 $echo " $pack $categ " $SV_NONL
63 if ( ls $pack/SELECTED* | grep -E SELECTED ) >/dev/null 2>&1
64 then
65 $echo "(selected) " $SV_NONL
66 else
67 $echo "(not selected) " $SV_NONL
68 fi
69 if [ ! -f $pack/DESCRIPTION ] ; then
70 echo "(DESCRIPTION not available)"
71 else
72 echo ""
73 fi
74 fi
75 done
76 done
77 echo "" ) | more
78 cd $MID_INSTALL
79 echo "Type <Q> to quit or <L> to list again."
80
81 while : ; do
82 $echo "Select NAME: " $SV_NONL
83 read name
84 if [ "$name" = "q" -o "$name" = "Q" ] ; then
85 clear
86 exit
87 fi
88 if [ "$name" = "l" -o "$name" = "L" ] ; then
89 break
90 fi
91 if [ "$name" = "" ] ; then
92 continue
93 fi
94 if [ -d $MID_HOME/applic/$name ] ; then
95 categ=applic
96 elif [ -d $MID_HOME/stdred/$name ] ; then
97 categ=stdred
98 elif [ -d $MID_HOME/contrib/$name ] ; then
99 categ=contrib
100 elif [ -d $MID_HOME/gui/$name ] ; then
101 categ=gui
102 else
103 echo "$name: No such package with that name"
104 continue
105 fi
106
107 if [ -f $MID_HOME/$categ/$name/DESCRIPTION ] ; then
108 cat $MID_HOME/$categ/$name/DESCRIPTION | more
109 echo ""
110 continue
111 else
112 echo "DESCRIPTION file for package <$name> not available."
113 fi
114 done
115 done
116 clear
117 exit