aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-11-14 10:23:31 +0000
committerWill Newton <will.newton@linaro.org>2014-11-17 10:38:31 +0000
commite4ecc015d2852eaf5a16c314155634eced6eab25 (patch)
tree35b536870b0605b3a81f32b7a9eaebdd5e4b3631
parenta0a784ad1743de094647a92d120a1cff6e2c79cc (diff)
lib/git-parser.sh: Make tool parsing more liberal
Strip off anything after -linaro so we can deal with a few more repositories. Change-Id: I5ebc18b984ef5a8281440e0820fc37b2e3bd5c82
-rw-r--r--lib/git-parser.sh6
-rwxr-xr-xtestsuite/test.sh11
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/git-parser.sh b/lib/git-parser.sh
index 5474af6..7c446a5 100644
--- a/lib/git-parser.sh
+++ b/lib/git-parser.sh
@@ -176,7 +176,7 @@ git_parser()
# Strip service information and any trailing branch information.
local tool="`echo ${in} | sed -e 's/lp://' -e 's:/.*::'`"
# Strip superflous -linaro tags
- local tool="`echo ${tool} | sed -e 's:-linaro::'`"
+ local tool="`echo ${tool} | sed -e 's:-linaro.*::'`"
echo ${tool}
;;
*)
@@ -220,7 +220,7 @@ git_parser()
# Strip any trailing branch information.
local tool="`echo ${in} | sed -e 's:-[0-9].*::'`"
# Strip off any -linaro tags.
- tool="`echo ${tool} | sed -e 's:-linaro::'`"
+ tool="`echo ${tool} | sed -e 's:-linaro.*::'`"
# Strip service information.
tool="`basename ${tool}`"
echo ${tool}
@@ -368,6 +368,8 @@ git_parser()
echo "${user}"
;;
tool)
+ # Strip off any -linaro tags.
+ tool="`echo ${tool} | sed -e 's:-linaro.*::'`"
echo "${tool}"
;;
url)
diff --git a/testsuite/test.sh b/testsuite/test.sh
index 6ea126c..fae408d 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -432,6 +432,17 @@ else
fixme "${in} returned ${out} but expected ${match}"
fi
+testing="get_toolname: linaro linux repository"
+in="http://git.linaro.org/kernel/linux-linaro-tracking.git~linux-linaro"
+out="`get_toolname ${in}`"
+match="linux"
+if test x"${out}" = x"${match}"; then
+ pass "${testing}"
+else
+ fail "${testing}"
+ fixme "${in} returned ${out} but expected ${match}"
+fi
+
# ----------------------------------------------------------------------------------
echo "============= fetch() tests ================"
out="`fetch md5sums 2>/dev/null`"