From patchwork Wed Oct 16 17:46:52 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: 21080 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 B7701202E6 for ; Wed, 16 Oct 2013 17:46:59 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i3sf3195761oag.2 for ; Wed, 16 Oct 2013 10:46:59 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=9hKhJm8/VICGK138NYkFuLE7R+rGg4q19H4l/UV6d68=; b=MdGqygSyCFzj0lpw7T5Opisk34q/n8pnlNsr0X2KSq0aP1TQ+i5u5RpeKbMB5hai6u 1rpLYZzcscSjZnEuDBngOjRP4XItazEG9Fnq8lUP0KhqIFXsUKIN9KLM7XgyQPYSd0Tu kgF+jX0cco3h35ixPUp2kN8AEvh6jAEf6gkNdeFuhhwWfdnDlPlX/Z2/b4QVGeSNbKac rIEge+VzH/dlSIlTqysyboMJCteDefuhQuuqXGXaCWpFlOzxNV6hjlfgwuMN71/nu6oS VOxJ/Q3VRp0014JDS2zXcYOwC2nRfyiBC++AGPwOPG7sryGpIUZpoxP1WwuI74B4CYAh MhCw== X-Received: by 10.182.105.227 with SMTP id gp3mr1372425obb.23.1381945619011; Wed, 16 Oct 2013 10:46:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.193 with SMTP id r1ls636609qek.30.gmail; Wed, 16 Oct 2013 10:46:58 -0700 (PDT) X-Received: by 10.58.233.98 with SMTP id tv2mr3279031vec.11.1381945618829; Wed, 16 Oct 2013 10:46:58 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id vh9si25005212vcb.25.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 10:46:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 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.45; Received: by mail-vb0-f45.google.com with SMTP id e15so552059vbg.32 for ; Wed, 16 Oct 2013 10:46:58 -0700 (PDT) X-Gm-Message-State: ALoCoQnYNFqAFx2gGHe6olyXOAbWAY2B4cWDnhh1MEAz7iWzvGLzOqYKSNZLPvGcOFq/I86qi6v4 X-Received: by 10.58.64.202 with SMTP id q10mr2405151ves.22.1381945618663; Wed, 16 Oct 2013 10:46:58 -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 u4csp57408vcz; Wed, 16 Oct 2013 10:46:58 -0700 (PDT) X-Received: by 10.50.55.40 with SMTP id o8mr22966234igp.25.1381945617943; Wed, 16 Oct 2013 10:46:57 -0700 (PDT) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by mx.google.com with ESMTPS id ay9si10467623icc.59.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 10:46:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.223.170 is neither permitted nor denied by best guess record for domain of ryan.arnold@linaro.org) client-ip=209.85.223.170; Received: by mail-ie0-f170.google.com with SMTP id at1so1999196iec.29 for ; Wed, 16 Oct 2013 10:46:57 -0700 (PDT) X-Received: by 10.43.60.139 with SMTP id ws11mr2697070icb.12.1381945617409; Wed, 16 Oct 2013 10:46:57 -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 yt10sm4333871igb.9.2013.10.16.10.46.56 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Wed, 16 Oct 2013 10:46:56 -0700 (PDT) From: "Ryan S. Arnold" To: Rob Savoye Cc: patches@linaro.org, "Ryan S. Arnold" Subject: [PATCH] cbuild2/lib/common.sh: redirect trace/error/warning, etc. to stderr. Date: Wed, 16 Oct 2013 12:46:52 -0500 Message-Id: <1381945612-31506-1-git-send-email-ryan.arnold@linaro.org> X-Mailer: git-send-email 1.8.3.1 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.45 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" Redirecting all tracing messages to standard error prevents tracing from polluting subshell invocation return values. This is important when a function is executed in a subshell and its output is gathered into a string variable, such as get_source. --- lib/common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index c307d93..397899c 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -60,33 +60,33 @@ dryrun() trace() { - echo "TRACE(#${BASH_LINENO}): ${FUNCNAME[1]} ($*)" + echo "TRACE(#${BASH_LINENO}): ${FUNCNAME[1]} ($*)" 1>&2 } fixme() { - echo "FIXME(#${BASH_LINENO}): ${FUNCNAME[1]} ($*)" + echo "FIXME(#${BASH_LINENO}): ${FUNCNAME[1]} ($*)" 1>&2 } error() { - echo "ERROR (#${BASH_LINENO}): $1" + echo "ERROR (#${BASH_LINENO}): $1" 1>&2 return 1 } warning() { if test "${verbose}" -gt 0; then - echo "WARNING: $1" + echo "WARNING: $1" 1>&2 fi } notice() { if test "${verbose}" -gt 0; then - echo "NOTE: $1" + echo "NOTE: $1" 1>&2 fi }