Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Mar 2014 01:38:17 +0000 (UTC)
From:      Julio Merino <jmmv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r263789 - user/jmmv/autotest/node
Message-ID:  <201403270138.s2R1cHrN001716@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmmv
Date: Thu Mar 27 01:38:17 2014
New Revision: 263789
URL: http://svnweb.freebsd.org/changeset/base/263789

Log:
  Determine whether to use svnlite or svn.
  
  Cluster machines are configured with WITH_SVN=yes, so let's not assume
  that the binary is called svnlite.

Modified:
  user/jmmv/autotest/node/setup.sh

Modified: user/jmmv/autotest/node/setup.sh
==============================================================================
--- user/jmmv/autotest/node/setup.sh	Thu Mar 27 01:32:44 2014	(r263788)
+++ user/jmmv/autotest/node/setup.sh	Thu Mar 27 01:38:17 2014	(r263789)
@@ -91,6 +91,22 @@ configfile() {
 }
 
 
+# Guesses the path to the svn binary for the host.
+svnpath() {
+    local candidates=
+    candidates="${candidates} /usr/bin/svn"
+    candidates="${candidates} /usr/bin/svnlite"
+
+    for candidate in ${candidates}; do
+        if [ -x "${candidate}" ]; then
+            echo "${candidate}"
+            return
+        fi
+    done
+    shtk_cli_error "No svn found"
+}
+
+
 # Prints the source directory of a specific component.
 #
 # \param component Name of the source component.
@@ -170,7 +186,7 @@ setup_enable_cron() {
 
     local timespec="30 */1 * * *"
     local entry="( cd '${dir}'"
-    entry="${entry}; svnlite update"
+    entry="${entry}; '$(svnpath)' update"
     entry="${entry}; make"
     entry="${entry}; ./setup all"
     entry="${entry} ) >/dev/null 2>/dev/null # AUTOTEST"
@@ -240,9 +256,9 @@ setup_sync_autotest() {
     local svnroot="$(shtk_config_get AUTOTEST_SVNROOT)"
     local revision="$(shtk_config_get AUTOTEST_REVISION)"
     if [ -d "${dir}" ]; then
-        ( cd "${dir}" && svnlite update -r "${revision}" )
+        ( cd "${dir}" && "$(svnpath)" update -r "${revision}" )
     else
-        svnlite co "${svnroot}@${revision}" "$(dirname "${dir}")"
+        "$(svnpath)" co "${svnroot}@${revision}" "$(dirname "${dir}")"
     fi
 
     make -C "${dir}/node" clean



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403270138.s2R1cHrN001716>