summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-04-13 13:50:01 +0200
committerGuido Günther <agx@sigxcpu.org>2013-04-13 14:26:24 +0200
commit1593648de8e251d2a7d98ed26f4a9905aaaba5c1 (patch)
tree5e1de7bda331acbd8b34158fe6f5d3d29e30cddb
parentd510f2a0c1cf6ca3a2c112e864774a46b2836efb (diff)
Add gbp.git.source.Source.sourcepkg
to easily fetch the source package name Git-Dch: Ignore
-rw-r--r--gbp/deb/source.py7
-rwxr-xr-xgbp/scripts/buildpackage.py10
2 files changed, 12 insertions, 5 deletions
diff --git a/gbp/deb/source.py b/gbp/deb/source.py
index 699038ae..1959ec9d 100644
--- a/gbp/deb/source.py
+++ b/gbp/deb/source.py
@@ -81,3 +81,10 @@ class DebianSource(object):
clf = self._vfs.open('debian/changelog')
self._changelog = ChangeLog(clf.read())
return self._changelog
+
+ @property
+ def sourcepkg(self):
+ """
+ The source package's name
+ """
+ return self.changelog['Source']
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 3410d745..13f7bf50 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -509,7 +509,7 @@ def main(argv):
# Export to another build dir if requested:
if options.export_dir:
- tmp_dir = os.path.join(output_dir, "%s-tmp" % source.changelog['Source'])
+ tmp_dir = os.path.join(output_dir, "%s-tmp" % source.sourcepkg)
export_source(repo, tree, source.changelog, options, tmp_dir, output_dir)
# Run postexport hook
@@ -520,7 +520,7 @@ def main(argv):
major = (source.changelog.debian_version if source.is_native()
else source.changelog.upstream_version)
- export_dir = os.path.join(output_dir, "%s-%s" % (source.changelog['Source'], major))
+ export_dir = os.path.join(output_dir, "%s-%s" % (source.sourcepkg, major))
gbp.log.info("Moving '%s' to '%s'" % (tmp_dir, export_dir))
move_old_export(export_dir)
os.rename(tmp_dir, export_dir)
@@ -548,13 +548,13 @@ def main(argv):
arch = os.getenv('ARCH', None) or du.get_arch()
changes = os.path.abspath("%s/../%s_%s_%s.changes" %
(build_dir,
- source.changelog['Source'],
+ source.sourcepkg,
source.changelog.noepoch, arch))
gbp.log.debug("Looking for changes file %s" % changes)
if not os.path.exists(changes):
changes = os.path.abspath("%s/../%s_%s_source.changes" %
(build_dir,
- source.changelog['Source'],
+ source.sourcepkg,
source.changelog.noepoch))
Command(options.postbuild, shell=True,
extra_env={'GBP_CHANGES_FILE': changes,
@@ -565,7 +565,7 @@ def main(argv):
if options.retag and repo.has_tag(tag):
repo.delete_tag(tag)
repo.create_tag(name=tag,
- msg="%s Debian release %s" % (source.changelog['Source'],
+ msg="%s Debian release %s" % (source.sourcepkg,
source.changelog.version),
sign=options.sign_tags, keyid=options.keyid)
if options.posttag: