diff options
-rwxr-xr-x | gbp/scripts/buildpackage_rpm.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py index be938aae..efc344d6 100755 --- a/gbp/scripts/buildpackage_rpm.py +++ b/gbp/scripts/buildpackage_rpm.py @@ -599,10 +599,13 @@ def main(argv): spec.specdir = os.path.abspath(spec_dir) if options.orig_prefix != 'auto': - options.orig_prefix = options.orig_prefix % dict(spec.version, - version=RpmPkgPolicy.compose_full_version(spec.version), - name=spec.name, - vendor=options.vendor) + try: + options.orig_prefix %= dict(spec.version, + version=RpmPkgPolicy.compose_full_version(spec.version), + name=spec.name, vendor=options.vendor) + except KeyError as err: + raise GbpError("Unknown key %s in orig prefix format " + "string" % err) elif spec.orig_src: options.orig_prefix = spec.orig_src['prefix'] |