<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -29,24 +29,24 @@ if [ $IN_GIT -eq 0 ]; then
 else
 	VERSTRING=$(git describe --tags --long 2&gt; /dev/null || git describe --tags)
 
-	# is this an RC?
-	if [ &quot;x$(echo $VERSTRING | grep rc)&quot; != &quot;x&quot; ]; then
+	# is this an rc, alpha, or beta?
+	if [ &quot;$(echo $VERSTRING | cut -d'-' -f 3 | grep &quot;^[0-9]*$&quot;)&quot; != &quot;&quot; ]; then
 		FID=4
-		IS_RC=1
+		IS_PRE=1
 	else
 		FID=3
-		IS_RC=0
+		IS_PRE=0
 	fi
 	
 	# is this an old version of git without --long support?
 	REVCOUNT=&quot;$(echo $VERSTRING | cut -d'-' -f $FID)&quot;
 	BASE_VERSION=&quot;$(echo $VERSTRING | cut -d'-' -f 1)&quot;
-	if [ $IS_RC -eq 1 ]; then
+	if [ $IS_PRE -eq 1 ]; then
 		BASE_VERSION=&quot;$BASE_VERSION-$(echo $VERSTRING | cut -d'-' -f 2)&quot;
 	fi
 
 	if [ &quot;$(echo $REVCOUNT | grep ^g)x&quot; == &quot;x&quot; ]; then
-		REVCOUNT=&quot;$(git rev-list $BASE_VERSION..HEAD | wc -l)&quot;
+		REVCOUNT=&quot;$(git rev-list $BASE_VERSION..HEAD | wc -l | sed 's/[ ]//g')&quot;
 		VERSTRING=&quot;$BASE_VERSION-$REVCOUNT-$(echo $VERSTRING | cut -d'-' -f $(($FID - 1)))&quot;
 	fi
 fi
@@ -56,10 +56,10 @@ MAJOR=`echo $VERSTRING | cut -d'.' -f1`
 MINOR=`echo $VERSTRING | cut -d'.' -f2`
 REVIS=`echo $VERSTRING | cut -d'.' -f3 | cut -d'-' -f 1`
 TINYBUILD=`echo $VERSTRING | cut -d'-' -f2`
-RC=
-if [ $(echo $TINYBUILD | grep rc) ]; then
+PRE=
+if [ $IS_PRE == 1 ]; then
 	# We've got a release candidate. Reparse to get the build -number-.
-	RC=-$TINYBUILD
+	PRE=-$TINYBUILD
 	TINYBUILD=`echo $VERSTRING | cut -d'-' -f3`
 fi
 
@@ -69,19 +69,22 @@ fi
 
 rm -f $OUT.tmp
 
+PREFIX=CC_LIB
+SHORT_TAG=cc
+
 cat &gt;&gt; $OUT.tmp &lt;&lt; __eof__
-#ifndef __included_cc_build_number_h
-#define __included_cc_build_number_h
-
-#define CC_LIB_VERSION_MAJOR $MAJOR
-#define CC_LIB_VERSION_MINOR $MINOR
-#define CC_LIB_VERSION_REVISION $REVIS
-#define CC_LIB_VERSION_BUILD $TINYBUILD
-#define CC_LIB_VERSION &quot;$MAJOR.$MINOR.$REVIS$RC&quot;
-#define CC_LIB_VERSION_STRING &quot;$VERSTRING&quot;
-
-#define CC_RESOURCE_VERSION $MAJOR,$MINOR,$REVIS,$TINYBUILD
-#define CC_RESOURCE_VERSION_STRING &quot;$MAJOR, $MINOR, $REVIS, $TINYBUILD&quot;
+#ifndef __included_$(echo $SHORT_TAG)_build_number_h
+#define __included_$(echo $SHORT_TAG)_build_number_h
+
+#define $(echo $PREFIX)_VERSION_MAJOR $MAJOR
+#define $(echo $PREFIX)_VERSION_MINOR $MINOR
+#define $(echo $PREFIX)_VERSION_REVISION $REVIS
+#define $(echo $PREFIX)_VERSION_BUILD $TINYBUILD
+#define $(echo $PREFIX)_VERSION &quot;$MAJOR.$MINOR.$REVIS$PRE&quot;
+#define $(echo $PREFIX)_VERSION_STRING &quot;$VERSTRING&quot;
+
+#define $(echo $PREFIX)_RESOURCE_VERSION $MAJOR,$MINOR,$REVIS,$TINYBUILD
+#define $(echo $PREFIX)_RESOURCE_VERSION_STRING &quot;$MAJOR, $MINOR, $REVIS, $TINYBUILD&quot;
 
 #endif
 </diff>
      <filename>tools/gen_buildnum_h.sh</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2e72a4b894a567248ba2cca03d8fa4a2c6b04cb8</id>
    </parent>
  </parents>
  <author>
    <name>Steven Noonan</name>
    <email>steven@uplinklabs.net</email>
  </author>
  <url>http://github.com/tycho/crisscross/commit/9377172e9069d666446c2bed71e57f6eaf438508</url>
  <id>9377172e9069d666446c2bed71e57f6eaf438508</id>
  <committed-date>2009-06-01T04:47:40-07:00</committed-date>
  <authored-date>2009-06-01T04:47:40-07:00</authored-date>
  <message>buildnumber: now allows any type of suffix ('rc', 'a', 'b', etc)

This gives a bit more flexibility in our versioning scheme.

Signed-off-by: Steven Noonan &lt;steven@uplinklabs.net&gt;</message>
  <tree>feaf75d0d24c17ded82e9e6500759cc129b6d2b8</tree>
  <committer>
    <name>Steven Noonan</name>
    <email>steven@uplinklabs.net</email>
  </committer>
</commit>
