X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/blobdiff_plain/9679ebb058b3be6f4aa3df45506380b535d9b1f6..8ff4cef3c79a36da6ab88cf2ee9a839451de6cbf:/invirtibuilder diff --git a/invirtibuilder b/invirtibuilder index f5cdfb4..0a19484 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -26,6 +26,8 @@ principal is the Kerberos principal that requested the build. """ +from __future__ import with_statement + import contextlib import os import re @@ -70,10 +72,14 @@ def getArches(package, ref): def getDscName(package, ref): """Return the .dsc file that will be generated for this package.""" v = getVersion(package, ref) - return '%s_%s-%s.dsc' % ( + if v.debian_version: + v_str = '%s-%s' % (v.upstream_version, + v.debian_version) + else: + v_str = v.upstream_version + return '%s_%s.dsc' % ( package, - version.upstream_version, - version.debian_version) + v_str) def sanitizeVersion(version): @@ -81,19 +87,17 @@ def sanitizeVersion(version): This function strips the epoch from the version number and replaces any tildes with periods.""" - v = '%s-%s' % (version.upstream_version, - version.debian_version) + if v.debian_version: + v = '%s-%s' % (version.upstream_version, + version.debian_version) + else: + v = version.upstream_version return v.replace('~', '.') def aptCopy(packages, dst_pocket, src_pocket): """Copy a package from one pocket to another.""" - binaries = [] - for line in b.getGitFile(package, commit, 'debian/control').split('\n'): - m = re.match('Package: (.*)$') - if m: - binaries.append(m.group(1)) - + binaries = getBinaries(package, commit) cpatureOutput(['reprepro-env', 'copy', b.pocketToApt(dst_pocket), b.pocketToApt(src_pocket),