[Haiku-commits] r31333 - haiku/trunk/build/jam

axeld at BerliOS axeld at mail.berlios.de
Tue Jun 30 17:20:55 CEST 2009


Author: axeld
Date: 2009-06-30 17:20:54 +0200 (Tue, 30 Jun 2009)
New Revision: 31333
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31333&view=rev

Modified:
   haiku/trunk/build/jam/FileRules
Log:
* Applied patch by Andreas to unify SVN version detection with GIT, also fixing
  bug #2860.


Modified: haiku/trunk/build/jam/FileRules
===================================================================
--- haiku/trunk/build/jam/FileRules	2009-06-30 15:16:50 UTC (rev 31332)
+++ haiku/trunk/build/jam/FileRules	2009-06-30 15:20:54 UTC (rev 31333)
@@ -315,14 +315,19 @@
 actions CopySetHaikuRevision1
 {
 	$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
-	revision=`LC_ALL=C LANG=C svn info $(HAIKU_TOP) 2> /dev/null |
-		grep Revision | awk '{printf $2}'`
+	# Try svn or git-svn
+	# Extract from "Revision: 12345" line
+	revision=`(LC_ALL=C LANG=C svn info $(HAIKU_TOP) ||
+		(cd $(HAIKU_TOP) && LC_ALL=C LANG=C git svn info)) 2> /dev/null |
+			grep Revision | awk '{printf $2}'`
 	if [ "$revision" = 0 -o "$revision" = "" ]; then
-		revision=`(cd $(HAIKU_TOP) && LC_ALL=C LANG=C git svn info)
-				2> /dev/null ||
-			(git log --max-count=1 --grep="git-svn-id:" 2> /dev/null |
-				grep git-svn-id: | cut -d '@' -f 2 |
-					awk '{printf $1}') 2> /dev/null`
+		# git-svn not present or not configured for this repository
+		# Try searching git logs for last git-svn commit
+		# Extract from " git-svn-id: .../haiku/trunk at 12345 ..." line
+		revision=`cd $(HAIKU_TOP) &&
+			git log --max-count=1 --grep="git-svn-id:" 2> /dev/null |
+				grep "git-svn-id:" | cut -d '@' -f 2 |
+					awk '{printf $1}'`
 	fi
 	if [ "$revision" = "" ]; then
 		revision=0




More information about the Haiku-commits mailing list