diff mbox

[Cbuildv2/get_source,05/17] lib/common.sh: Invoke find_snapshot as a subshell in get_source.

Message ID 1382129579-5777-6-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 current use of find_snapshot in get_source is erroneously directly
invoked and its output isn't properly trapped and pollutes the stdout of
get_source, which can make get_source erroneously return output in an
error case.

Putting this in place regresses the tar.bz2 test case.  This will be fixed
in a following commit.
---
 lib/common.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/lib/common.sh b/lib/common.sh
index 6fb7b7b..1e3bc9f 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -363,8 +363,8 @@  get_source()
     # If a full URL isn't passed as an argument, assume we want a
     # tarball snapshot
     if test `echo $1 | egrep -c "^svn|^git|^http|^bzr|^lp|\.git"` -eq 0; then
-	find_snapshot $1
-	# got an error
+        local snapshot
+	snapshot=`find_snapshot $1`
 	if test $? -gt 0; then
 	    if test x"${interactive}" = x"yes"; then
 	     	notice "Pick a unique snapshot name from this list: "