Changeset 343 for SH_SHM/trunk


Ignore:
Timestamp:
03/10/2011 01:47:22 PM (13 years ago)
Author:
marcus
Message:

r182 | walther | 2011-03-10 13:46:51 +0100 (Do, 10 Mär 2011) | 1 line

minor changes in setup routine

Location:
SH_SHM/trunk/setup
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/setup/SHM-install.csh

    r340 r343  
    2525if  (! -w $dstpath)  then 
    2626        echo "$0 : cannot write to installation path $dstpath.  Abort." 
    27         exit 
     27        exit 1 
    2828endif 
    2929 
     
    7373        if  (! -e "$res")  then 
    7474                echo "Program $p not found in search path.  Please add." 
    75                 exit 
     75                exit 2 
    7676        endif 
    7777end 
     
    9595        set cmd="$<" 
    9696 
    97         if  ("$cmd" == "q")  exit 
     97        if  ("$cmd" == "q")  exit 99 
    9898        if  ("$cmd" == "r")  then 
    9999                if  ("$displ_res" == "xga")  then 
     
    156156else 
    157157        echo "$0 : sorry, this operating system is not supported" 
    158         exit 
     158        exit 3 
    159159endif 
    160160set locsatpath=$dstpath/sh/util/locsat 
     
    167167        if  ($plth > 25)  then 
    168168                echo "$0 : cannot find short locsat path.  Abort." 
    169                 exit 
     169                exit 4 
    170170        endif 
    171171endif 
     
    209209if  (! -e $origsetup)  then 
    210210        echo "Installation program error.  Sorry." 
    211         exit 
     211        exit  5 
    212212endif 
    213213set thissetup=$dstpath/sh/inputs/shm-config.txt 
    214 if  (-e $thissetup)  \mv $thissetup $dstpath/sh/inputs/shm-config.txt.yours 
     214if  (-e $thissetup)  then 
     215    \mv $thissetup $dstpath/sh/inputs/shm-config.txt.yours 
     216    echo "A backup of your shm-config.txt has been saved under:" 
     217    echo $dstpath/sh/inputs/shm-config.txt.yours 
     218endif 
    215219sed "s@##EDITOR##@$editor@" $origsetup > $thissetup 
    216220 
  • SH_SHM/trunk/setup/makerelease.sh

    r330 r343  
    5656    cat decompress.sh > /tmp/SHM-install.sh 
    5757    base64 $TMPDIR/SHM.tar.gz >> /tmp/SHM-install.sh 
     58    chmod 755 /tmp/SHM-install.sh 
    5859} 
    5960 
  • SH_SHM/trunk/setup/setup.py

    r340 r343  
    3333 
    3434def banner(): 
    35     print "="*78 
     35    print "="*70 
    3636    print "  Setup program v0.1 for Seismic Handler (SH/SHM)" 
    37     print "="*78 
     37    print "="*70 
    3838    print "\n This piece of software will try to setup the included source code.\n" 
    3939 
    40 def download(target, pkg): 
     40def download(target, pkg, dbg): 
    4141    print "Downloading %s..." % pkg 
    42     os.system("wget -q -P %s %s" % (target, downloads[pkg])) 
     42 
     43    verbose = dbg and "" or "-q " 
     44 
     45    if os.system("wget %s-P %s %s" % (verbose, target, downloads[pkg])): 
     46        abort("Cannot download %s. Exit here." % pkg) 
    4347 
    4448def setup(**kwargs): 
     
    8387 
    8488    copy(os.path.join(data["pwd"], ".."), os.path.join(target, "sh"), dbg) 
    85     download(target, "locsat") 
    86     download(target, "fk") 
     89    download(target, "locsat", dbg) 
     90    download(target, "fk", dbg) 
    8791 
    88     install(target) 
    89     customize(target) 
     92    exitcode = install(target, dbg) 
     93    if exitcode == 99: 
     94        abort("Installation aborted.") 
     95    elif exitcode: 
     96        abort("Installation errors occured. Please check output.") 
    9097 
    91 def customize(target): 
     98    customize(target, dbg) 
     99 
     100def customize(target, dbg): 
    92101    """ 
    93102    Offers usage of new configuration files. 
     
    97106 
    98107    flist = ["STATINF.DAT", "sensitivities.txt", "filter_lookup.txt"] 
    99  
    100     print "\nA backup of your shm-config.txt has been saved under" 
    101     print " %s/sh/inputs/shm-config.txt.yours" % target 
    102108 
    103109    print "\nSeismic Handler comes with updated station configuration files." 
     
    117123        os.system("cp %s %s" % (tname+".dist", tname)) 
    118124 
    119 def install(target): 
    120     os.system(os.path.join(target, "sh/setup/SHM-install.csh %s" % target)) 
     125def install(target, dbg): 
     126    exitcode = \ 
     127         os.system(os.path.join(target, "sh/setup/SHM-install.csh %s" % target)) 
     128 
     129    return exitcode >> 8 
    121130 
    122131def copy(src, trt, dbg=False): 
Note: See TracChangeset for help on using the changeset viewer.