diff mbox

[Cbuildv2/get_source,07/17] lib/common.sh: echo ${url} in get_source when finding a successful snapshot match.

Message ID 1382129579-5777-8-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>

Also move immediate successful snapshot match return 0 into an else leg so
that non-matches don't cascade erroneously to success without a match.
---
 lib/common.sh     | 10 +++++++---
 testsuite/test.sh |  2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/lib/common.sh b/lib/common.sh
index 1fcc06b..80f5fe9 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -369,6 +369,8 @@  get_source()
 	snapshot=`find_snapshot $1`
 	if test $? -gt 0; then
 	    if test x"${interactive}" = x"yes"; then
+		# TODO: Add a testcase for this leg, conditional on
+		# interactive.
 	     	echo "Pick a unique snapshot name from this list: " 1>&2
 		for i in ${snapshot}; do
 		    echo "	$i" 1>&2
@@ -381,7 +383,7 @@  get_source()
 		    # If there is a config file for this toolchain component,
 		    # see if it has a latest version set. If so, we use that.
 		    if test x"${latest}"  != x; then
-		        fixme "explicit snapshot listed in latest." 1>&2
+			# TODO: Add a testcase for this leg.
 			local url=`find_snapshot ${latest}`
 			return $?
 		    fi
@@ -397,10 +399,12 @@  get_source()
 		    return 1
 		fi
 	    fi
+	else
+	    echo ${snapshot}
+	    return 0
 	fi
-	local url=${snapshot}
-	return 0
     else
+	# TODO: Add a testcase for this leg?
 	if test `echo $1 | egrep -c "\.git"` -eq 0; then
 	    local url=$1
 	    return 0
diff --git a/testsuite/test.sh b/testsuite/test.sh
index 37b0f2a..7013830 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -374,6 +374,8 @@  fi
 
 # ----------------------------------------------------------------------------------
 
+echo "========= create_release_tag() tests ============"
+
 date="`date +%Y%m%d`"
 in="gcc.git/gcc-4.8-branch@12345abcde"
 out="`create_release_tag ${in} | grep -v TRACE`"