summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-12-25 12:28:28 +0100
committerGuido Günther <agx@sigxcpu.org>2017-12-25 12:28:28 +0100
commit13cd3b4af38342283c962709c0ce777509eb7e6d (patch)
tree904c8d60438805cc34abcf719f599982600e781a
parent3003d0778aed0afcfe766d1595348b83e59df616 (diff)
Handle KeyboardInterrupt in pristine_tar, push, rpm_ch and tag
to avoid python exceptions on the console. The other commands handle it already.
-rw-r--r--gbp/scripts/pristine_tar.py6
-rwxr-xr-xgbp/scripts/push.py2
-rw-r--r--gbp/scripts/rpm_ch.py3
-rwxr-xr-xgbp/scripts/tag.py2
4 files changed, 11 insertions, 2 deletions
diff --git a/gbp/scripts/pristine_tar.py b/gbp/scripts/pristine_tar.py
index 24b1bc65..792bcab6 100644
--- a/gbp/scripts/pristine_tar.py
+++ b/gbp/scripts/pristine_tar.py
@@ -71,7 +71,7 @@ def parse_args(argv):
def main(argv):
- ret = 0
+ ret = 1
repo = None
(options, args) = parse_args(argv)
@@ -100,10 +100,12 @@ def main(argv):
repo.create_pristine_tar_commits(upstream_tag,
tarball,
component_tarballs)
+ ret = 0
except (GitRepositoryError, GbpError, CommandExecFailed) as err:
if str(err):
gbp.log.err(err)
- ret = 1
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
if not ret:
comp_msg = (' with additional tarballs for %s'
diff --git a/gbp/scripts/push.py b/gbp/scripts/push.py
index 268abbed..868b0954 100755
--- a/gbp/scripts/push.py
+++ b/gbp/scripts/push.py
@@ -170,6 +170,8 @@ def main(argv):
except (GbpError, GitRepositoryError, DebianSourceError) as err:
if str(err):
gbp.log.err(err)
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
return retval
diff --git a/gbp/scripts/rpm_ch.py b/gbp/scripts/rpm_ch.py
index 5b74efa7..199ada29 100644
--- a/gbp/scripts/rpm_ch.py
+++ b/gbp/scripts/rpm_ch.py
@@ -445,6 +445,9 @@ def main(argv):
if len(err.__str__()):
gbp.log.err(err)
return 1
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
+ return 1
finally:
del_tmpdir()
diff --git a/gbp/scripts/tag.py b/gbp/scripts/tag.py
index 1b16f2de..1e91fcdf 100755
--- a/gbp/scripts/tag.py
+++ b/gbp/scripts/tag.py
@@ -151,6 +151,8 @@ def main(argv):
except (GbpError, GitRepositoryError, DebianSourceError) as err:
if str(err):
gbp.log.err(err)
+ except KeyboardInterrupt:
+ gbp.log.err("Interrupted. Aborting.")
return retval