Use version as the tag name
[invirt/packages/invirt-dev.git] / invirtibuilder
index 9198549..d152b18 100755 (executable)
@@ -93,13 +93,13 @@ def sanitizeVersion(version):
     """Sanitize a Debian package version for use as a git tag.
 
     This function strips the epoch from the version number and
     """Sanitize a Debian package version for use as a git tag.
 
     This function strips the epoch from the version number and
-    replaces any tildes with periods."""
-    if v.debian_version:
+    replaces any tildes with underscores."""
+    if version.debian_version:
         v = '%s-%s' % (version.upstream_version,
                        version.debian_version)
     else:
         v = version.upstream_version
         v = '%s-%s' % (version.upstream_version,
                        version.debian_version)
     else:
         v = version.upstream_version
-    return v.replace('~', '.')
+    return v.replace('~', '_')
 
 
 def aptCopy(package, commit, dst_pocket, src_pocket):
 
 
 def aptCopy(package, commit, dst_pocket, src_pocket):
@@ -152,7 +152,8 @@ def tagSubmodule(pocket, package, commit, principal, version, env):
                                         principal))
 
         c.captureOutput(
                                         principal))
 
         c.captureOutput(
-            ['git', 'tag', '-m', tag_msg, commit],
+            ['git', 'tag', '-m', tag_msg, '--', sanitizeVersion(version),
+             commit],
             env=env,
             cwd=b.getRepo(package))
 
             env=env,
             cwd=b.getRepo(package))