From patchwork Fri Oct 18 20:52:46 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: 21176 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D641202E6 for ; Fri, 18 Oct 2013 20:53:38 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id hu19sf2418040vcb.1 for ; Fri, 18 Oct 2013 13:53:38 -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=wLnVh3tHbo6iqmV+qUXF3+VOWPmN1L5Jhwaj4Ndqsag=; b=HDdF1PnjBfY3HSaegVFHPVtF+S2p9lO1LQwuJQriw1PJs3tL5e/SR9cZgMwHpIQSdy gIcUnA206p39vNQMiYU1z8PsDgidltZFNUH6sHC6D9IFMWVcm0Q12unE60B790/gGONf wmFe6sBNuF4EHARgSkX2kvYPQ0MsC3A0Y2y/1w4xYQlSNtBFnEnmw4KeJTw1Rl84ORiz tAiDEVy9b2szBxAYYIctjfs287eY4Opx5wQNC7WJTcwVUQV1MJi8PUHpHfD/3+Q36PJ3 oqHIkqNrZAf+2dz+eWzNFUJsCf0xhCuZ4O8s+aUcz35XGFPjPJ1tszfZXivCgX7Wbb6a 2zYA== X-Received: by 10.58.221.193 with SMTP id qg1mr1688969vec.5.1382129618091; Fri, 18 Oct 2013 13:53:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.226 with SMTP id hv2ls1385207qeb.22.gmail; Fri, 18 Oct 2013 13:53:37 -0700 (PDT) X-Received: by 10.58.38.200 with SMTP id i8mr3411481vek.6.1382129617952; Fri, 18 Oct 2013 13:53:37 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id ip2si675392vcb.41.2013.10.18.13.53.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 13:53:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz11so608981vcb.24 for ; Fri, 18 Oct 2013 13:53:37 -0700 (PDT) X-Gm-Message-State: ALoCoQlsaaJta84dp1HjC18eZpDxvKHGsCzyWfjI2Jr/EbRQ71D/ZCV4OPvvx/sptiI8YAJAHJnc X-Received: by 10.58.64.202 with SMTP id q10mr1883755ves.22.1382129617819; Fri, 18 Oct 2013 13:53:37 -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 u4csp63327vcz; Fri, 18 Oct 2013 13:53:37 -0700 (PDT) X-Received: by 10.42.48.202 with SMTP id t10mr3149905icf.9.1382129617217; Fri, 18 Oct 2013 13:53:37 -0700 (PDT) Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) by mx.google.com with ESMTPS id b10si3319917icq.144.2013.10.18.13.53.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 13:53:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.223.178 is neither permitted nor denied by best guess record for domain of ryan.arnold@linaro.org) client-ip=209.85.223.178; Received: by mail-ie0-f178.google.com with SMTP id to1so10026957ieb.9 for ; Fri, 18 Oct 2013 13:53:36 -0700 (PDT) X-Received: by 10.42.232.206 with SMTP id jv14mr2627160icb.52.1382129616751; Fri, 18 Oct 2013 13:53:36 -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.35 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2013 13:53:36 -0700 (PDT) From: "Ryan S. Arnold" To: Rob Savoye Cc: patches@linaro.org, "Ryan S. Arnold" Subject: [PATCH][Cbuildv2/get_source 04/17] lib/common.sh: Suppress extraneous trailing whitespace in get_URL and get_source output. Date: Fri, 18 Oct 2013 15:52:46 -0500 Message-Id: <1382129579-5777-5-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.220.179 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" 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(-) diff --git a/lib/common.sh b/lib/common.sh index e6655a1..6fb7b7b 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -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 }