[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[UDD] Help needed for exit code of udd.py



Hi,

I realised that the bibref gatherer today was unable to fetch the input
data.  After having added 'set -e' to the update script I would have
expected that the update-and-run.sh script which is basically doing

 $DIR/udd.py $CONFIG update "$@" && \
  $DIR/udd.py $CONFIG run "$@"

would stop after the update step and does not execute the run step.
However, this is not the case.  For the purpose of demonstration I
applied this patch:

Index: udd.py
===================================================================
--- udd.py      (Revision 2154)
+++ udd.py      (Arbeitskopie)
@@ -62,6 +62,7 @@
         if "update-command" in src_config:
           result = system(src_config['update-command']) 
           if result != 0:
+            print "False =", result
             sys.exit(result)
         end_time = get_timestamp()
       else:


and tried:

$ udd.py config-org.yaml update bibref && echo test
False = 2048
test


Could anybody explain why if the python script exits a non-zero value
the second part of the statement (&& echo test) is executed?

Kind regards

       Andreas.

-- 
http://fam-tille.de


Reply to: