From: Evan Broder Date: Sun, 22 Nov 2009 21:07:21 +0000 (-0500) Subject: Deal with Debian-native packages correctly when calculating and X-Git-Tag: 0.1.5~80 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/commitdiff_plain/e4e24100a77914be7540861e7b667e9e022bf650 Deal with Debian-native packages correctly when calculating and formatting version numbers. svn path=/trunk/packages/invirt-dev/; revision=2544 --- diff --git a/invirtibuilder b/invirtibuilder index f5cdfb4..65423ee 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -70,10 +70,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,8 +85,11 @@ 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('~', '.')