summaryrefslogtreecommitdiff
path: root/gbp/scripts
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-05-30 20:02:39 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-03-08 13:13:37 +0200
commit7c70b088e200f38cf36fe14d65826cb9a055bcd1 (patch)
treed5dc496d36b16fb72c64999d03f3f4c69d845c08 /gbp/scripts
parent10264f5cc34afdcfc9e33d3564ba3e7efc43d156 (diff)
downloadgit-buildpackage-7c70b088e200f38cf36fe14d65826cb9a055bcd1.tar.gz
git-buildpackage-7c70b088e200f38cf36fe14d65826cb9a055bcd1.tar.bz2
git-buildpackage-7c70b088e200f38cf36fe14d65826cb9a055bcd1.zip
rpm helpers: make SpecFile and SrcRpmFile give (full) version as dict.
The Dictionary contains different "version components", such as upstreamversion, release and epoch. Makes e.g. tag creation consistent, now. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/scripts')
-rwxr-xr-xgbp/scripts/buildpackage_rpm.py9
-rwxr-xr-xgbp/scripts/import_srpm.py8
-rwxr-xr-xgbp/scripts/pq_rpm.py12
3 files changed, 15 insertions, 14 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index 8c4df9a8..610c9181 100755
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -143,7 +143,7 @@ def pristine_tar_build_orig(repo, orig_file, output_dir, options):
def get_upstream_tree(repo, spec, options):
"""Determine the upstream tree from the given options"""
if options.upstream_tree.upper() == 'TAG':
- upstream_tree = repo.version_to_tag(options.upstream_tag, dict(upstreamversion=spec.version), "Upstream")
+ upstream_tree = repo.version_to_tag(options.upstream_tag, dict(upstreamversion=spec.upstreamversion), "Upstream")
elif options.upstream_tree.upper() == 'BRANCH':
if not repo.has_branch(options.upstream_branch):
raise GbpError("%s is not a valid branch" % options.upstream_branch)
@@ -564,11 +564,12 @@ def main(argv):
# Tag (note: tags the exported version)
if options.tag or options.tag_only:
- gbp.log.info("Tagging %s" % spec.version)
- tag = repo.version_to_tag(options.packaging_tag, dict(upstreamversion=spec.version), options.vendor)
+ gbp.log.info("Tagging %s" % rpm.RpmPkgPolicy.compose_full_version(spec.version))
+ tag = repo.version_to_tag(options.packaging_tag, spec.version, options.vendor)
if options.retag and repo.has_tag(tag):
repo.delete_tag(tag)
- repo.create_tag(name=tag, msg="%s release %s" % (options.vendor, spec.version),
+ repo.create_tag(name=tag, msg="%s release %s" % (options.vendor,
+ rpm.RpmPkgPolicy.compose_full_version(spec.version)),
sign=options.sign_tags, keyid=options.keyid, commit=tree)
if options.posttag:
sha = repo.rev_parse("%s^{}" % tag)
diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py
index 615d6c46..c90f694f 100755
--- a/gbp/scripts/import_srpm.py
+++ b/gbp/scripts/import_srpm.py
@@ -192,8 +192,8 @@ def main(argv):
spec = parse_spec(pkg)
pkgname = spec.name
- pkgver = dict(upstreamversion=spec.version, release=spec.release)
- upstream_version = spec.version
+ pkgver = spec.version
+ upstream_version = spec.upstreamversion
packager = spec.packager
unpacked = True
else:
@@ -201,8 +201,8 @@ def main(argv):
dirs['src'] = os.path.abspath(os.path.dirname(pkg))
src = parse_srpm(srpm)
pkgname = src.name
- pkgver = dict(upstreamversion=src.version)
- upstream_version = src.upstream_version
+ pkgver = src.version
+ upstream_version = src.upstreamversion
packager = src.packager
unpacked = False
diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py
index 1af68b5e..249807b7 100755
--- a/gbp/scripts/pq_rpm.py
+++ b/gbp/scripts/pq_rpm.py
@@ -104,9 +104,9 @@ def export_patches(repo, branch, options):
raise GbpError, "Can't parse spec"
# Find upstream version
- upstream_commit = repo.find_version(options.upstream_tag, dict(upstreamversion=spec.version), "Upstream")
+ upstream_commit = repo.find_version(options.upstream_tag, dict(upstreamversion=spec.upstreamversion), "Upstream")
if not upstream_commit:
- raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.version)
+ raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.upstreamversion)
for n, p in spec.patches.iteritems():
if p['autoupdate']:
@@ -223,12 +223,12 @@ def import_spec_patches(repo, branch, tries, options):
raise GbpError, "Can't parse spec"
# Find upstream version
- commit = repo.find_version(options.upstream_tag, dict(upstreamversion=spec.version), "Upstream")
+ commit = repo.find_version(options.upstream_tag, dict(upstreamversion=spec.upstreamversion), "Upstream")
if commit:
#commits = repo.commits(num=tries, first_parent=True)
commits=[commit]
else:
- raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.version)
+ raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.upstreamversion)
queue = spec.patchseries()
packager = get_packager(spec)
@@ -286,9 +286,9 @@ def rebase_pq(repo, branch, options):
raise GbpError, "Can't parse spec"
# Find upstream version
- upstream_commit = repo.find_version(options.upstream_tag, dict(upstreamversion=spec.version), "Upstream")
+ upstream_commit = repo.find_version(options.upstream_tag, dict(upstreamversion=spec.upstreamversion), "Upstream")
if not upstream_commit:
- raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.version)
+ raise GbpError, ("Couldn't find upstream version %s. Don't know on what base to import." % spec.upstreamversion)
switch_to_pq_branch(repo, branch, options)
GitCommand("rebase")([upstream_commit])