From patchwork Fri Oct 18 20:52:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ryan S. Arnold" X-Patchwork-Id: 21189 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2449B202E6 for ; Fri, 18 Oct 2013 20:53:54 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i3sf13078476oag.10 for ; Fri, 18 Oct 2013 13:53:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=8W0WfkWwlj11lr76fJ4OY7DbAWIRR/9wQ4Ke1Sp/oqw=; b=SLbBMWGLlu4yT0VDUn2n+9RqAz9RyR5PLxqRnVXiTVl9JKhXx+bYG3pHE8vrKcWrcS xt+6EGJTjhyuxWqKSB8WmjuN2RfGKqyiNDsGASgs97WwKC9T3kpuCeQEnXMG68jWEL+r FJhEHlDRzgQmsdMKjig2Kdg7pDri6KM7BV2gSrME2YHMB0AOUCY4erEL+snS8NkMwJnc 1L7TOTEcPCgIexJF3IKPGbj5M7p8eMp3VaQ44goR4VoILh7/vDXHTorxFiGXUKJJlQuR vVNu6mjkrGW9CiNd3WlLIYA1OXEv6MMv8xUCiL2dFU9lo/DdTDpoItjD9iOKQYyG3GRq zeqw== X-Received: by 10.43.114.67 with SMTP id ez3mr1589885icc.6.1382129633663; Fri, 18 Oct 2013 13:53:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.102 with SMTP id 6ls1381324qel.40.gmail; Fri, 18 Oct 2013 13:53:53 -0700 (PDT) X-Received: by 10.220.169.203 with SMTP id a11mr585789vcz.26.1382129633531; Fri, 18 Oct 2013 13:53:53 -0700 (PDT) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id st7si665052vdc.120.2013.10.18.13.53.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 13:53:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.48; Received: by mail-vb0-f48.google.com with SMTP id w8so1450980vbf.35 for ; Fri, 18 Oct 2013 13:53:53 -0700 (PDT) X-Gm-Message-State: ALoCoQm6rso9hyJAnmiS/UQ6EJc7zBaxHZu5CA1K4+h+5fZ5jWAKQXg01jQplYv5iyN2r0W17mpg X-Received: by 10.221.6.195 with SMTP id ol3mr20796vcb.34.1382129633380; Fri, 18 Oct 2013 13:53:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp63348vcz; Fri, 18 Oct 2013 13:53:52 -0700 (PDT) X-Received: by 10.42.62.196 with SMTP id z4mr2616500ich.49.1382129632676; Fri, 18 Oct 2013 13:53:52 -0700 (PDT) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) by mx.google.com with ESMTPS id mi10si3357953icc.76.2013.10.18.13.53.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 13:53:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.223.177 is neither permitted nor denied by best guess record for domain of ryan.arnold@linaro.org) client-ip=209.85.223.177; Received: by mail-ie0-f177.google.com with SMTP id e14so7234511iej.22 for ; Fri, 18 Oct 2013 13:53:52 -0700 (PDT) X-Received: by 10.50.77.83 with SMTP id q19mr902778igw.21.1382129631905; Fri, 18 Oct 2013 13:53:51 -0700 (PDT) Received: from badwing.hsd1.mn.comcast.net. (c-71-195-40-9.hsd1.mn.comcast.net. [71.195.40.9]) by mx.google.com with ESMTPSA id cl4sm14877361igc.1.2013.10.18.13.53.50 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2013 13:53:51 -0700 (PDT) From: "Ryan S. Arnold" To: Rob Savoye Cc: patches@linaro.org, "Ryan S. Arnold" Subject: [PATCH][Cbuildv2/get_source 17/17] lib/common.sh: get_source - Fix for partial match in snapshots with .conf:latest set. Date: Fri, 18 Oct 2013 15:52:59 -0500 Message-Id: <1382129579-5777-18-git-send-email-ryan.arnold@linaro.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1382129579-5777-1-git-send-email-ryan.arnold@linaro.org> References: <1382129579-5777-1-git-send-email-ryan.arnold@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ryan.arnold@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: "Ryan S. Arnold" This fix also removes repositories that aren't used from testsuite/test_sources.conf and adds a few new test cases. --- lib/common.sh | 21 ++++++++++++++------- testsuite/test.sh | 27 +++++++++++++++++++++++++-- testsuite/test_sources.conf | 43 ++++--------------------------------------- 3 files changed, 43 insertions(+), 48 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index 0cbc532..08370b3 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -378,16 +378,23 @@ get_source() echo " $i" 1>&2 done read answer - local url="`find_snapshot ${answer}`" - return $? + local url + url="`find_snapshot ${answer}`" + local ssret=$? + echo "${url}" + return ${ssret} else if test x"${snapshot}" != x; then - # If there is a config file for this toolchain component, - # see if it has a latest version set. If so, we use that. + # It's possible that the value passed in to get_sources + # didn't match any known snapshots OR there were too many + # matches. Check .conf:latest to see if there's a + # matching snapshot. if test x"${latest}" != x; then - # TODO: Add a testcase for this leg. - local url=`find_snapshot ${latest}` - return $? + local url + url=`find_snapshot ${latest}` + local ssret=$? + echo "${url}" + return ${ssret} fi # Technically 'notice' and 'get_URL' already suppress without # verbose being set but no reason to do unnecessary work. diff --git a/testsuite/test.sh b/testsuite/test.sh index 25709eb..eda2ffa 100755 --- a/testsuite/test.sh +++ b/testsuite/test.sh @@ -328,6 +328,10 @@ echo "============= get_source() tests ================" # This might be due to running testsuite in a builddir rather than a # source dir. +# get_sources might, at times peak at latest for a hint if it can't find +# things. Keep it unset unless you want to test a specific code leg. +latest='' + # Test get_source with a variety of inputs in="asdfasdf" out="`get_source ${in} 2>&1`" @@ -446,9 +450,9 @@ else fixme "get_source returned ${out}" fi -in="gcc-4.6" +in="gcc-4.8" out="`get_source ${in} 2>/dev/null`" -if test x"${out}" = x"svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch"; then +if test x"${out}" = x"svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch"; then pass "get_source: tag matching an svn repo in ${sources_conf}" else fail "get_source: tag matching an svn repo in ${sources_conf}" @@ -491,6 +495,25 @@ else fixme "get_source returned ${out}" fi +latest='' +in="gcc-linaro-4.8" +out="`get_source ${in} 2>/dev/null`" +if test x"${out}" = x""; then + pass "get_source: partial match in snapshots, latest not set." +else + fail "get_source: partial match in snapshots, latest not set." + fixme "get_source returned ${out}" +fi + +latest="gcc-linaro-4.8-2013.06.tar.bz2" +in="gcc-linaro-4.8" +out="`get_source ${in} 2>/dev/null`" +if test x"${out}" = x"gcc-linaro-4.8-2013.06.tar.bz2"; then + pass "get_source: too many matches in snapshots, latest set." +else + fail "get_source: partial matches in snapshots, latest set." + fixme "get_source returned ${out}" +fi # ---------------------------------------------------------------------------------- echo "========= create_release_tag() tests ============" diff --git a/testsuite/test_sources.conf b/testsuite/test_sources.conf index 90a053b..80253b2 100644 --- a/testsuite/test_sources.conf +++ b/testsuite/test_sources.conf @@ -2,50 +2,15 @@ # This is a table of URLs for checking out development sources. # NOTE: use spaces instead of TABs # +# For Testing Only -# GCC -gcc-4.6 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch -gcc-4.7 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch gcc-4.8 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch -gcc-aarch64-4.7 svn://gcc.gnu.org/svn/gcc/branches/ARM/aarch64-4.7-branch -gcc-embedded-4.6 svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_6-branch -gcc-google-4.6 svn://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6 -#gcc svn://gcc.gnu.org/svn/gcc/trunk +gcc-4.7 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch gcc.git git://git.linaro.org/toolchain/gcc.git -#gcc-linaro-4.7 lp:gcc-linaro/4.7 -gcc-linaro-4.6 lp:gcc-linaro/4.6 -gdb-linaro-7.6 lp:gdb-linaro/7.6 -gdb-linaro-7.5 lp:gdb-linaro/7.5 -clang http://llvm.org/svn/llvm-project/cfe/trunk -cfe http://llvm.org/svn/llvm-project/cfe/trunk - -# Binutils binutils.git git://git.linaro.org/toolchain/binutils.git -gdb.git git://git.linaro.org/toolchain/gdb.git - -# Libraries -llvm http://llvm.org/svn/llvm-project/llvm/trunk -eglibc.git git://git.linaro.org/toolchain/eglibc.git -glibc.git git://git.linaro.org/toolchain/glibc.git -newlib.git git://git.linaro.org/toolchain/newlib.git libgloss.git git://git.linaro.org/toolchain/newlib.git -cortex-strings lp:cortex-strings -libav.git git://git.libav.org/libav.git -libffi.git git://github.com/atgreen/libffi.git - -crosstool-ng-linaro lp:~linaro-toolchain-dev/crosstool-ng/linaro - -boot-wrapper.git git://git.linaro.org/arm/models/boot-wrapper.git - +newlib.git git://git.linaro.org/toolchain/newlib.git +eglibc.git git://git.linaro.org/toolchain/eglibc.git bitbake.git git://git.openembedded.org/bitbake -llvm-test-suite http://llvm.org/svn/llvm-project/test-suite/trunk - -meta-linaro.git git://git.linaro.org/openembedded/meta-linaro.git -openembedded-core.git git://git.openembedded.org/openembedded-core -valgrind svn://svn.valgrind.org/valgrind/trunk -qemu.git git://git.qemu.org/qemu.git -qemu-linaro.git git://git.linaro.org/qemu/qemu-linaro.git - -# For Testing Only # nomatch.git don't uncomment and don't use this identifier. foo.git git://testingrepository/foo