debian: Update check for Debian package version.
authorBen Pfaff <blp@nicira.com>
Fri, 7 Jan 2011 17:35:19 +0000 (09:35 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 7 Jan 2011 17:35:19 +0000 (09:35 -0800)
A version number like "1.1.0pre2" is properly translated into a Debian
version number as "1.1.0~pre2", so we need to make that translation.  Also,
the Debian version number will often have suffixes on it, so don't check
for a trailing parenthesis.

debian/automake.mk

index f493100..c6e584a 100644 (file)
@@ -43,12 +43,13 @@ EXTRA_DIST += \
        debian/rules.modules
 
 check-debian-changelog-version:
-       @if $(FGREP) '($(VERSION))' $(srcdir)/debian/changelog >/dev/null; \
-       then                                                               \
-         :;                                                               \
-       else                                                               \
-         echo "Update debian/changelog to mention version $(VERSION)";    \
-         exit 1;                                                          \
+       @DEB_VERSION=`echo '$(VERSION)' | sed 's/pre/~pre/'`;                \
+       if $(FGREP) '($(DEB_VERSION)' $(srcdir)/debian/changelog >/dev/null; \
+       then                                                                 \
+         :;                                                                 \
+       else                                                                 \
+         echo "Update debian/changelog to mention version $(VERSION)";      \
+         exit 1;                                                            \
        fi
 ALL_LOCAL += check-debian-changelog-version
 DIST_HOOKS += check-debian-changelog-version