From: Eric S. Raymond Date: Sun, 13 May 2012 18:48:48 +0000 (-0400) Subject: Use defaults appropriately. Bail out on failed command. X-Git-Tag: 1.0~13 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=51e58956dc9f2af95461b8ff219f094e6e00402a;p=coverity-submit.git Use defaults appropriately. Bail out on failed command. --- diff --git a/coverity-submit b/coverity-submit index 1fac603..9ce8c0c 100755 --- a/coverity-submit +++ b/coverity-submit @@ -53,10 +53,14 @@ else: die("Every project requires an email option.") if config.has_option(project, "upload"): upload = config.get(project, "upload") +elif config.has_option("DEFAULT", "upload"): + upload = config.get("DEFAULT", "upload") else: die("Every project requires an upload option.") if config.has_option(project, "advertise"): advertise = config.get(project, "advertise") +elif config.has_option("DEFAULT", "advertise"): + upload = config.get("DEFAULT", "advertise") else: die("Every project requires an advertise option.") if config.has_option(project, "prebuild"): @@ -81,6 +85,7 @@ def do_or_die(cmd): if not noexec: if os.system(cmd) != 0: sys.stderr.write("Command failed.\n") + sys.exit(1) # Build local stuff print("Rebuilding and scanning...")