Debian Codegraph @

install/unix/update1

raw symbols SCIP
1 #! /bin/bashscip-shell filesystem . . `/bin/bash`.
2 # .COPYRIGHT: Copyright (c) 1988-2011 European Southern Observatory,
3 # all rights reserved
4 # .TYPE command
5 # .NAME update1.sh
6 # .LANGUAGE shell script
7 # .ENVIRONMENT Unix Systems. Executable under SHELL and C-SHELL
8 # .COMMENTS Installation procedure of the MIDAS system starting from
9 # scratch.
10 # Usage: install1 system [options]
11 #
12 # .AUTHOR Carlos Guirao
13 # .VERSION 3.1 910724: New implementation.
14 # 111206 last modif
15
16 echo=echo
17 if [scip-shell system . . `[`. "`echoscip-shell system . . 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 adn
25 # <dirname> & <basename> commands emulated with <sed>
26 # cd `dirname $0`
27 # MIDVERS=`basename $VERSDIR`
28 # MIDASHOME=`dirname $VERSDIR`
29 #
30 if [scip-shell system . . `[`. -z "$MIDASHOME" -o -z "$MIDVERS" ] ; then
31 cd `echoscip-shell system . . echo. $0 | sedscip-shell system . . sed. -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'`
32 MID_INSTALL=`pwdscip-shell system . . pwd.`
33 VERSDIR=`echoscip-shell system . . echo. $MID_INSTALL | sedscip-shell system . . sed. 's/\/install\/unix$//'`
34 MIDVERS=`echoscip-shell system . . echo. $VERSDIR | sedscip-shell system . . sed. -e 's/^.*\///'`
35 MIDASHOME=`echoscip-shell system . . echo. $VERSDIR | sedscip-shell system . . 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 cd $MID_INSTALL
44
45 clearscip-shell system . . clear.
46 if [scip-shell system . . `[`. ! -f "$MID_HOME/local/default.mk" ] ; then
47 echoscip-shell system . . echo. "*** ERROR: File <$MID_HOME/local/default.mk> does not exist."
48 echoscip-shell system . . echo. "*** You need to run <preinstall> before continuing with <update>"
49 exit 1
50 fi
51
52 if [scip-shell system . . `[`. ! -f "$MID_HOME/local/make_options" ] ; then
53 touchscip-shell system . . touch. $MID_HOME/local/make_options
54 fi
55
56 echoscip-shell system . . echo. ""
57 echoscip-shell system . . echo. "MIDAS UPDATE PROCEDURE"
58 echoscip-shell system . . echo. "======================"
59 echoscip-shell system . . echo. "MIDASHOME: $MIDASHOME"
60 echoscip-shell system . . echo. "MIDVERS: $MIDVERS"
61 echoscip-shell system . . echo. "MAKE_OPTIONS:"
62 awkscip-shell system . . awk. -F# '{ if ($1 != "") {printf "\t %s\n",$1} }' $MID_HOME/local/make_options
63 echoscip-shell system . . echo. ""
64 echoscip-shell system . . echo. "NOTE: Update will only compile and link those files and"
65 echoscip-shell system . . echo. " executables not updated in previous installation"
66 echoscip-shell system . . echo. " It will run in background and the output will be sent to"
67 echoscip-shell system . . echo. " the file <$MID_HOME/tmp/update.$$>"
68 echoscip-shell system . . echo. ""
69 $echo "Do you want to continue [yn]? (y): " $SV_NONL
70 read answ
71 if [scip-shell system . . `[`. -z "$answ" ]; then
72 answ=y
73 fi
74 if [scip-shell system . . `[`. "$answ" != "y" -a "$answ" != "Y" ]
75 then
76 echoscip-shell system . . echo. "Bye"
77 exit 0
78 fi
79
80 #
81 # If $MID_HOME/tmp does not exists then creates it.
82 #
83 if [scip-shell system . . `[`. ! -d $MID_HOME/tmp ]; then
84 mkdirscip-shell system . . mkdir. $MID_HOME/tmp
85 fi
86
87 time /bin/bashscip-shell filesystem . . `/bin/bash`. $MID_INSTALL/update -i > $MID_HOME/tmp/update.$$ 2>&1 &
88 echoscip-shell system . . echo. "Running update in background"
89 echoscip-shell system . . echo. "Results are coming in $MID_HOME/tmp/update.$$"