From patchwork Fri May 29 10:58:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 49158 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B2C1218E7 for ; Fri, 29 May 2015 10:58:50 +0000 (UTC) Received: by wixv7 with SMTP id v7sf5049312wix.0 for ; Fri, 29 May 2015 03:58:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=o6H31x/y4VOowr2/DgE9cXe0obz0d6SBpw9neth6rH0=; b=OeU9Mdz3PydUK95lQ0boPy2d2XdsnLkuIzg9K2oSNOGX+Sa7TdzKRUDjZFPUpxP9ow tHNSUY70Xk0H0WibMLZIR1412571KpQSuL4TENwksXl5y9VsC9sz1vBNAXqpycUgodW4 0i8xg9dAYXCfu4jFMrJg58OuFPNfxbzN4ZKgXgvXTIrD/JLv60nNRt/eFnQMQPjjnsWN rYCmls/7og4h4hgVJlmzGB+b2eSj3wHgA2YrMVF2lYYhMnMy9ZPURlDKfj/wHRoz/M8y ty1g0zBv14LYzH6hQDnwD7vkyGvjfCnsA5+nybxwm0Zr0DuX5zE8sWLOPuG8vCL0l66R W6ng== X-Gm-Message-State: ALoCoQlFYsNP8v7P3p2hFaDnOqsuRNbzLPZ7fASfcD1wpO3Yz3BYbXTo7UGmjt7CsDGs8iT2RkeW X-Received: by 10.152.26.134 with SMTP id l6mr6842103lag.10.1432897129631; Fri, 29 May 2015 03:58:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.98 with SMTP id ln2ls65112lac.91.gmail; Fri, 29 May 2015 03:58:49 -0700 (PDT) X-Received: by 10.112.42.16 with SMTP id j16mr7207862lbl.98.1432897129485; Fri, 29 May 2015 03:58:49 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ld16si4375468lbb.169.2015.05.29.03.58.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 03:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcmx3 with SMTP id mx3so45994656lbc.1 for ; Fri, 29 May 2015 03:58:49 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr7384530laj.88.1432897129387; Fri, 29 May 2015 03:58:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp218545lbb; Fri, 29 May 2015 03:58:48 -0700 (PDT) X-Received: by 10.140.98.237 with SMTP id o100mr8727094qge.1.1432897128119; Fri, 29 May 2015 03:58:48 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w94si5221361qge.60.2015.05.29.03.58.47; Fri, 29 May 2015 03:58:48 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id EA08961FA8; Fri, 29 May 2015 10:58:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D08ED61FA1; Fri, 29 May 2015 10:58:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 89ADF61FA5; Fri, 29 May 2015 10:58:41 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id 8C5BE61FA1 for ; Fri, 29 May 2015 10:58:40 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2so45952358lbb.3 for ; Fri, 29 May 2015 03:58:39 -0700 (PDT) X-Received: by 10.152.37.201 with SMTP id a9mr7206595lak.120.1432897119061; Fri, 29 May 2015 03:58:39 -0700 (PDT) Received: from erachmi-VirtualBox.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by mx.google.com with ESMTPSA id ky7sm1312627lab.37.2015.05.29.03.58.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 May 2015 03:58:37 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org Date: Fri, 29 May 2015 12:58:26 +0200 Message-Id: <1432897106-12266-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2] apply-and-build.sh: fixing cover-letter issue X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christophe.milard@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 When an empty patch (such as a cover letter) was given to apply-and-build, the latter would fail applying the patch and all following patches (saying OK when it could be wrong) Signed-off-by: Christophe Milard --- apply-and-build.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apply-and-build.sh b/apply-and-build.sh index 7195f40..d4cc0d9 100755 --- a/apply-and-build.sh +++ b/apply-and-build.sh @@ -147,18 +147,16 @@ apply_patch() { echo " Trying to apply patch" git am ${patch} >> ${logfile_basename}-am.log 2>&1 - egrep "^Patch failed at" ${logfile_basename}-am.log > /dev/null - if [ $? -eq 0 ]; then + if [ $? -ne 0 ]; then cat ${logfile_basename}-am.log - git am --abort || exit 1 + git am --abort git checkout . || exit 1 git clean -xdf || exit 1 git am --3way ${patch} >> ${logfile_basename}-am-3way.log 2>&1 - egrep "^Patch failed at" ${logfile_basename}-am-3way.log > /dev/null - if [ $? -eq 0 ]; then + if [ $? -ne 0 ]; then cat ${logfile_basename}-am-3way.log echo " Error: Patch failed to apply" - git am --abort || exit 1 + git am --abort git checkout . || exit 1 git clean -xdf || exit 1 popd > /dev/null