summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-07-11 15:40:59 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-14 14:47:20 +0200
commit9e0976d6e0a64ad48699e9902e87e962ebca02fd (patch)
treef5e29d6c6b0318361ffa2a71f529352aacabb1dc
parentd56a4c56c462cc08740a6e53fc3a46c8339d036d (diff)
downloadgit-buildpackage-9e0976d6e0a64ad48699e9902e87e962ebca02fd.tar.gz
git-buildpackage-9e0976d6e0a64ad48699e9902e87e962ebca02fd.tar.bz2
git-buildpackage-9e0976d6e0a64ad48699e9902e87e962ebca02fd.zip
buildpackage-rpm: don't crash on invalid vcs format strings
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/buildpackage_rpm.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index 74a8aeb3..b458de60 100755
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -685,7 +685,10 @@ def main(argv):
else:
vcs_info = get_vcs_info(repo, tree)
# Put 'VCS:' tag to .spec
- spec.set_tag('VCS', None, options.spec_vcs_tag % vcs_info)
+ try:
+ spec.set_tag('VCS', None, options.spec_vcs_tag % vcs_info)
+ except KeyError as err:
+ raise GbpError("Unknown key %s in vcs tag format string" % err)
spec.write_spec_file()
except CommandExecFailed: