Description: Use upstream version number for snapshot builds
 Date based version numbers cause snapshot builds to become
 non-reproducible and the date of the most recent changelog entry
 doesn't make sense as version number.
Author: Axel Beckert <abe@debian.org>
Forwarded: not-needed

--- a/version.sh
+++ b/version.sh
@@ -6,8 +6,8 @@
 
 if [ -z "$MAJOR" -o -z "$RELEASE" -o -z "$REVISION" ] ; then
   MAJOR="0"
-  RELEASE="$(date +%Y%m%d)"
-  REVISION=0
+  RELEASE="$(dpkg-parsechangelog -SVersion | sed -e 's/^0\.\([0-9]*\)\~git.*$/\1/')"
+  REVISION="$(dpkg-parsechangelog -SVersion | sed -e 's/^.*\~\(git[^-]*\)-[0-9].*$/\1/')"
 fi
 
 VERSION="$MAJOR.$RELEASE.$REVISION"
