@@ -118,13 +118,10 @@ get_URL()
if test -e ${srcs}; then
if test "`grep -c "^${node}" ${srcs}`" -gt 1; then
error "Need unique component and version to get URL!"
- echo "" 1>&2
- echo "Choose one from this list" 1>&2
-# list_URL $1
return 1
fi
local url="`grep "^${node}" ${srcs} | sed -e 's:^.* ::'`"
- echo "${url} ${branch} ${revision}"
+ echo "${url}${branch:+ ${branch}}${revision:+ ${revision}}"
return 0
else
@@ -437,7 +434,7 @@ get_source()
fi
fi
- echo "${url} ${branch} ${revision}"
+ echo "${url}${branch:+ ${branch}}${revision:+ ${revision}}"
return 0
}
From: "Ryan S. Arnold" <ryan.arnold@linaro.org> Change uses of echo "${url} ${branch} ${revision}" in get_URL and get_source to "${url}${branch:+ ${branch}}${revision:+ ${revision}}" in order to suppress unnecessary spaces which makes parsing the return value cumbersome due to potential trailing whitespace. --- lib/common.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)