summaryrefslogtreecommitdiff
path: root/gbp/scripts
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-08-19 20:07:35 +0200
committerGuido Günther <agx@sigxcpu.org>2014-08-19 22:02:26 +0200
commitae5805e4db74e844f78777c2fd91f409e0fcd7a8 (patch)
treef28e0d72dda6928b9890fdf60f7fc3889b8f53bc /gbp/scripts
parent6823e519deaf2a37a3d6225cd0392954c423b569 (diff)
Improve error messages on formatting errors
Make it easier for the user to detect misformated replacement strings in config files and command line options.
Diffstat (limited to 'gbp/scripts')
-rwxr-xr-xgbp/scripts/buildpackage.py7
-rw-r--r--gbp/scripts/import_orig.py3
2 files changed, 6 insertions, 4 deletions
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 86cf270..ef058ae 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -29,6 +29,7 @@ from gbp.command_wrappers import (Command,
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup)
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
from gbp.deb.source import DebianSource, DebianSourceError
+from gbp.format import format_msg
from gbp.git.vfs import GitVfs
from gbp.deb.upstreamsource import DebianUpstreamSource
from gbp.errors import GbpError
@@ -603,9 +604,9 @@ def main(argv):
gbp.log.info("Tagging %s as %s" % (source.changelog.version, tag))
if options.retag and repo.has_tag(tag):
repo.delete_tag(tag)
- tag_msg=options.debian_tag_msg % dict(
- pkg=source.sourcepkg,
- version=source.changelog.version)
+ tag_msg = format_msg(options.debian_tag_msg,
+ dict(pkg=source.sourcepkg,
+ version=source.changelog.version))
repo.create_tag(name=tag,
msg=tag_msg,
sign=options.sign_tags, keyid=options.keyid)
diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py
index 8eed96b..a08c1c3 100644
--- a/gbp/scripts/import_orig.py
+++ b/gbp/scripts/import_orig.py
@@ -29,6 +29,7 @@ from gbp.deb.changelog import ChangeLog, NoChangeLogError
from gbp.deb.git import (GitRepositoryError, DebianGitRepository)
from gbp.config import GbpOptionParserDebian, GbpOptionGroup, no_upstream_branch_msg
from gbp.errors import GbpError
+from gbp.format import format_msg
import gbp.log
from gbp.scripts.common.import_orig import (orig_needs_repack, cleanup_tmp_tree,
ask_package_name, ask_package_version,
@@ -373,7 +374,7 @@ def main(argv):
epoch = '%s:' % cp.epoch
info = { 'version': "%s%s-1" % (epoch, version) }
env = { 'GBP_BRANCH': options.debian_branch }
- gbpc.Command(options.postimport % info, extra_env=env, shell=True)()
+ gbpc.Command(format_msg(options.postimport, info), extra_env=env, shell=True)()
# Update working copy and index if we've possibly updated the
# checked out branch
current_branch = repo.get_branch()