diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-08-08 17:47:40 -0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-08-08 17:47:40 -0300 |
commit | 874de925d8fbf582f7bf51b722bbfe81240b74eb (patch) | |
tree | 2f4f7ea74ce234f075b19c46f6f599d8a14a6398 /gbp/deb | |
parent | 3e4e7950d2b0e81a8821f60e9a6d842c88e8b7fb (diff) |
deb.policy: fail with a GbpError when we hit an unknown compression
Diffstat (limited to 'gbp/deb')
-rw-r--r-- | gbp/deb/policy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gbp/deb/policy.py b/gbp/deb/policy.py index 9a118114..d9b27ac0 100644 --- a/gbp/deb/policy.py +++ b/gbp/deb/policy.py @@ -23,6 +23,7 @@ like allowed characters in version numbers, etc. import os import re +from gbp.errors import GbpError from gbp.pkg.pkgpolicy import PkgPolicy from gbp.pkg.compressor import Compressor @@ -86,7 +87,10 @@ class DebianPkgPolicy(PkgPolicy): @return: the tarballs name corresponding to the input parameters @rtype: C{str} """ - ext = Compressor.Exts[compression] + try: + ext = Compressor.Exts[compression] + except KeyError: + raise GbpError("Unknown compression type '%s'" % compression) sub = '-{0}'.format(component) if component else '' tarball = "%s_%s.orig%s.tar.%s" % (name, version, sub, ext) if dir: |