r17120 - gnucash/trunk/util - SVK detection on Windows is not trivial :-)

Andreas Köhler andi5 at cvs.gnucash.org
Mon Apr 21 16:59:50 EDT 2008


Author: andi5
Date: 2008-04-21 16:59:50 -0400 (Mon, 21 Apr 2008)
New Revision: 17120
Trac: http://svn.gnucash.org/trac/changeset/17120

Modified:
   gnucash/trunk/util/gnc-svnversion
Log:
SVK detection on Windows is not trivial :-)

Patch from Daniel Harding.


Modified: gnucash/trunk/util/gnc-svnversion
===================================================================
--- gnucash/trunk/util/gnc-svnversion	2008-04-21 20:59:42 UTC (rev 17119)
+++ gnucash/trunk/util/gnc-svnversion	2008-04-21 20:59:50 UTC (rev 17120)
@@ -54,22 +54,31 @@
   fi
 fi
 
+if test $OSTYPE == "msys"
+then
+  svk_name="svk.bat"
+  svk_cmd="cmd \/c svk"
+else
+  svk_name="svk"
+  svk_cmd="svk"
+fi
+
 # Maybe it's SVK?  First, check if we've got 'svk' in the path.  If not,
 # then exit with an error code of 1..
-which svk >/dev/null 2>&1
+which $svk_name >/dev/null 2>&1
 if test $? != 0 ; then exit 1 ; fi
 
 # Okay, we have 'svk'.  Now see if $real_srcdir is an svk checkout
 # Note that the 'echo n' is to protect against having svk installed
 # without having configured the depotmap.
-svkinfo=`echo n | svk info "$real_srcdir" 2>&1`
+svkinfo=`echo n | $svk_cmd info "$real_srcdir" 2>&1`
 if test $? != 0 ; then exit 1 ; fi
 
 # If we got here, then $real_srcdir is an svk checkout.  Parse out
 # the revision info, print it out, and then output 0.  Just combine
 # all the revision numbers into a single string by combining them
 # with periods.
-svkinfo=`svk info "$real_srcdir" | grep Rev | head -5 | sed -e 's/^.* \([0-9:]*\)$/\1/'`
-echo $svkinfo | sed -e 's/\s/./g'
+svkinfo=`$svk_cmd info "$real_srcdir" | grep Rev | head -5 | sed -e 's/^.* \([0-9:]*\)$/\1/'`
+echo $svkinfo | sed -e 's/ /./g'
 
 exit 0



More information about the gnucash-changes mailing list