configure: pull the version number from Bazaar

Michael Hope michael.hope@linaro.org
Thu Oct 20 03:38:00 GMT 2011


If '.version' ends with bzr then use bzr to automatically add the
revision number to the version string.

Mirrors the current support for Mercurial.  Uses Debian style versions
with a '+' to indicate after.

.version will normally contain '1.12.4+bzr'.  CT_VERSION will end up
as '1.12.4+bzr1234'.  If the revno can't be found fall back to a
Debian style date such as '1.12.4+bzr+20111009'.

Linaro does most of its work in Launchpad and Bazaar.  I'm happy to
keep this as a local patch if need be.

Signed-off-by: Michael Hope <michael.hope@linaro.org>


diff --git a/configure b/configure
index 6a68b38..0e7d23e 100755
--- a/configure
+++ b/configure
@@ -550,6 +550,16 @@
          # arbitrarily deep directory structure
          VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )"
          ;;
+    *bzr)
+	REVISION="$( bzr revno 2>/dev/null || true )"
+        case "${REVISION}" in
+            "")
+                VERSION="${VERSION}+$( date +%Y%m%d.%H%M%S )";;
+            *)
+                VERSION="${VERSION}${REVISION}";
+                ;;
+	esac
+	;;
  esac
  printf "${VERSION}\n"


--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list