[Wien] force exit upon compile error in siteconfig

Peter Blaha pblaha at zeus.theochem.tuwien.ac.at
Tue Apr 20 10:56:03 CEST 2004


> A scripting question.

Each Unix command returns a "status" variable (from an "exit x" statement.

echo $status is zero if the command exits without error, but non-zero else.

It is quite trivial to check this, as done in eg. run_lapw:

if ($status) exit 1


However, for siteconfig you would have to handle the "dirlist" properly

if ($sel == a) set dirlist = SRC_*

This includes also directories where there is nothing to compile
(e.g SRC_w2web). Of course when  "make" is executed there, it gives an
"error" and global compilation would stop.
So either create a "good" dirlist, or put a "dummy" Makefile into those
subdirectories to avoid an "error".

>
> In the siteconfig script when one tries to compile all the programs if
> one of the programs doesn't compile (say lapw1 for example) the script
> continues working, trying to compile the next program and so on.  This
> behaviour has some obvious benefits, but does anyone know how to
> make the script siteconfig exit, or stop attempting to compile, if one of
> the programs doesn't compile.
>
> Thanks much,
>
> Fred
>
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>


                                      P.Blaha
--------------------------------------------------------------------------
Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
Phone: +43-1-58801-15671             FAX: +43-1-58801-15698
Email: blaha at theochem.tuwien.ac.at    WWW: http://info.tuwien.ac.at/theochem/
--------------------------------------------------------------------------




More information about the Wien mailing list