aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2006-11-01 03:53:00 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2006-11-01 03:53:00 +0000
commitcc310ea0eda3a0b6e80a16c3e812617ea165b170 (patch)
treecb45e5a16a5b1fb776640eed2230d3cf0105dd09
parent3e7445ccaac74a97c2e32f4cb07eff1cb9829c36 (diff)
downloadmgarepo-cc310ea0eda3a0b6e80a16c3e812617ea165b170.tar
mgarepo-cc310ea0eda3a0b6e80a16c3e812617ea165b170.tar.gz
mgarepo-cc310ea0eda3a0b6e80a16c3e812617ea165b170.tar.bz2
mgarepo-cc310ea0eda3a0b6e80a16c3e812617ea165b170.tar.xz
mgarepo-cc310ea0eda3a0b6e80a16c3e812617ea165b170.zip
- make create-srpm handle exceptions intended to be handled, so that we
don't receive the ugly traceback when upload-srpm fails
-rwxr-xr-xcreate-srpm9
1 files changed, 7 insertions, 2 deletions
diff --git a/create-srpm b/create-srpm
index 67f6f15..b8004a2 100755
--- a/create-srpm
+++ b/create-srpm
@@ -63,7 +63,8 @@ class CmdIface:
upload_command.append(x)
upload_command.append(targetname)
upload_command.append(targetsrpms[0])
- status, output = execcmd(" ".join(upload_command))
+ status, output = execcmd(" ".join(upload_command),
+ noerror=1)
if status != 0:
raise CmdError, "Failed to upload %s:\n%s" % (targetsrpms[0], output)
return 1
@@ -92,7 +93,11 @@ def parse_options():
def main():
iface = CmdIface()
opts, args = parse_options()
- iface.submit_package(args[0], opts.revision, opts.target, opts.urlmap, opts.define)
+ try:
+ iface.submit_package(args[0], opts.revision, opts.target, opts.urlmap, opts.define)
+ except Error, e:
+ sys.stderr.write("error: %s\n" % str(e))
+ sys.exit(1)
if __name__ == "__main__":