diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-11-27 19:59:32 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-11-27 19:59:32 +0100 |
commit | b1eba728d48985e64596acfe881b8e97578a5b3c (patch) | |
tree | e6b35a949585490f09b6765a066ea62061ad3ab9 | |
parent | 085291be763051d1beddbac960bb78be6089a632 (diff) |
dch: allow to reraise exceptions
This eases debugging since we can do
GBP_DEBUG=raise gbp dch …
and get the exception trace without modifying the source
-rw-r--r-- | gbp/scripts/common/__init__.py | 5 | ||||
-rw-r--r-- | gbp/scripts/dch.py | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gbp/scripts/common/__init__.py b/gbp/scripts/common/__init__.py index 5a8223fa..e49930e4 100644 --- a/gbp/scripts/common/__init__.py +++ b/gbp/scripts/common/__init__.py @@ -31,6 +31,11 @@ class ExitCodes(object): uscan_up_to_date = 4 # Uscan up to date (import-orig only) +def maybe_debug_raise(): + if 'raise' in os.getenv("GBP_DEBUG", '').split(','): + raise + + def is_download(args): """ >>> is_download(["http://foo.example.com"]) diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index 9aea564d..9db1a233 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -30,7 +30,7 @@ from gbp.deb import compare_versions from gbp.deb.source import DebianSource, DebianSourceError from gbp.deb.git import GitRepositoryError, DebianGitRepository from gbp.deb.changelog import ChangeLog, NoChangeLogError -from gbp.scripts.common import ExitCodes +from gbp.scripts.common import ExitCodes, maybe_debug_raise user_customizations = {} snapshot_re = re.compile("\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*") @@ -570,6 +570,7 @@ def main(argv): if str(err): gbp.log.err(err) ret = 1 + maybe_debug_raise() finally: os.chdir(old_cwd) return ret |