diff --git a/build.sh b/build.sh
index 1275f41fe11f1330c49d8e6f9a492b53bc75b196..dfb0ddad7a174e79c99b592b008ac2a5bfbf5986 100755
--- a/build.sh
+++ b/build.sh
@@ -279,7 +279,7 @@ then
       # mangle the changelog
       dch --force-bad-version \
           --distribution unstable \
-          --newversion "${VIEWER_VERSION}" \
+          --newversion "${revision}" \
           "Automated build #$build_id, repository $branch revision $revision." \
           >> "$build_log" 2>&1