Ignore:
Timestamp:
03/10/2011 01:47:22 PM (12 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.