Browse Source

Add support of tildes in dpkg's version

Dpkg's version is generated from the name of the closest git tag with the
help of get-version. But tag names can't contain tildes. Thus we use
underscore instead. This commit fixes get-version to replace underscores
back to tildes.
Raphaël Hertzog 12 years ago
parent
commit
aa3add4dbc
1 changed files with 3 additions and 2 deletions
  1. 3 2
      get-version

+ 3 - 2
get-version

@@ -22,8 +22,9 @@ if [ -f .dist-version ]; then
   # Get the version from the file distributed in the tarball.
   version=$(cat .dist-version)
 elif [ -d .git ]; then
-  # Ger the version from the git repository.
-  version=$(git describe --abbrev=4 HEAD 2>/dev/null)
+  # Get the version from the git repository. Since tags can't contain
+  # tildes, we use underscore instead. Reverse that switch here.
+  version=$(git describe --abbrev=4 HEAD 2>/dev/null | sed -e 's/_/~/g')
 
   # Check if we are on a dirty checkout.
   git update-index --refresh -q >/dev/null