diff mbox

[Cbuildv2/get_source,15/17] lib/common.sh: Fix so that get_URL works for <repo>.git@revision.

Message ID 1382129579-5777-16-git-send-email-ryan.arnold@linaro.org
State New
Headers show

Commit Message

Ryan S. Arnold Oct. 18, 2013, 8:52 p.m. UTC
From: "Ryan S. Arnold" <ryan.arnold@linaro.org>

The get_URL function was only working properly for <repo>.git/<branch> and
<repo>.git/branch@revision.
---
 lib/common.sh     | 4 +++-
 testsuite/test.sh | 5 ++---
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/lib/common.sh b/lib/common.sh
index f681d28..0cbc532 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -104,7 +104,9 @@  get_URL()
 #    trace "$*"
 
     local srcs="${sources_conf}"
-    local node="`echo $1 | cut -d '/' -f 1`"
+    # account for <repo>.git/<branch>@<revision> and
+    # account for <repo>.git@<revision>
+    local node="`echo $1 | cut -d '/' -f 1 | cut -d '@' -f 1`"
     local branch="`echo $1 | cut -d '/' -f 2 | cut -d '@' -f 1`"
     if test x"${branch}" = x"${node}"; then
 	local branch=
diff --git a/testsuite/test.sh b/testsuite/test.sh
index e570c50..2cd79d5 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -363,11 +363,10 @@  fi
 in="newlib.git@e9a210b"
 out="`get_source ${in}`"
 if test x"${out}" = x"git://git.linaro.org/toolchain/newlib.git e9a210b"; then
-    pass "get_source: git repository with commit"
+    pass "get_source: <repo>.git@commit"
 else
-    fail "get_source: git repository with commit"
+    fail "get_source: <repo>.git@commit"
     fixme "get_source returned ${out}"
-    fixme "should return git://git.linaro.org/toolchain/newlib.git e9a210b"
 fi
 
 in="gcc-linaro-4.8-2013.05.tar.bz2"