From patchwork Thu Jun 1 09:43:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent McIntyre X-Patchwork-Id: 9759137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A1726038E for ; Thu, 1 Jun 2017 09:43:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10B8E27F93 for ; Thu, 1 Jun 2017 09:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0275A284F8; Thu, 1 Jun 2017 09:43:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCE8327F93 for ; Thu, 1 Jun 2017 09:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539AbdFAJnn (ORCPT ); Thu, 1 Jun 2017 05:43:43 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:36467 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbdFAJnm (ORCPT ); Thu, 1 Jun 2017 05:43:42 -0400 Received: by mail-it0-f45.google.com with SMTP id m47so32102128iti.1 for ; Thu, 01 Jun 2017 02:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=pkU0nDYVOUynXeagvYf23p/pPxsBllJTKgdgFuGDB2g=; b=Za1gSaAAZbGwGEnS604SJdeh8/P/Jzs9X5sIZ1ZT35vbQPO/DOqwTa3IOU1Dy6+M9B EEJAXsV2YgPf3vNwxQoKbNFzP3N1uF+BTw1k9WRl8DifqCsxmBoR0RE3/2BZ689HiYmH ToIauc92N4GXBpiC0r97MDNL8IsUle1bvA/hJqCAO1QFq8e0NWEbZvnzoy5LH1nxkuAt udMoKtbLDiuSlX7gexif/h/TgcNbxCJaS85AVqWwcIG/0GTUNQ5u4vJSEhKcnvWwKkgs l0+fAYZHL1s+hcA94NCRp4ugKFuiDqGvunEguDyFL7HdV7NlCiq7+N7vEo9nswzKL45X 6Eog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=pkU0nDYVOUynXeagvYf23p/pPxsBllJTKgdgFuGDB2g=; b=jO5Vmep7czDkM+32f2/V6n8VuxYzrfYgME9hfHPPxlrY448a97chnXXNjdWqSueLMs 1icHPk32qN6oGp7l/cdDUedOERapj6hMHOqNrSh5ByltxuWG6gVE0wC1TfQbHtgp4YRZ 09rCn0ELqbj8EFjWsWeMoODNU0MtFKvUQKCzMspY/aofkFoSIu2lbJMOx3IqDTB38jwi Srjmk8Mt+HNf6W66JUdJVXDDsgFAoCoB2K6xLgLEjXfp3XDkrUnjku6VPv4FT3xY3vbB 7Cqrybs/xT5CpjnKOtnGJ3PKbmOd1oOFwyOnAAso4hObswpU0Y90lSxBL9s0CkESS1J5 zeSQ== X-Gm-Message-State: AODbwcBZhtN6HdvI3QDZkwlL3VKhj+zQhnGnR2mXFm2YfnmiqnKRpEOp GaXhdtAyjiTqx3/a X-Received: by 10.84.208.236 with SMTP id c41mr95239394plj.95.1496310216558; Thu, 01 Jun 2017 02:43:36 -0700 (PDT) Received: from ubuntu.windy (c122-106-153-7.carlnfd1.nsw.optusnet.com.au. [122.106.153.7]) by smtp.gmail.com with ESMTPSA id 192sm29624809pfb.10.2017.06.01.02.43.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 02:43:35 -0700 (PDT) Date: Thu, 1 Jun 2017 19:43:45 +1000 From: Vincent McIntyre To: linux-media@vger.kernel.org Subject: [PATCH] Small fix to build script Message-ID: <20170601094343.GA3212@ubuntu.windy> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid going splat if --depth is not given Commit 6b4a9c5 indroduced the --depth parameter to limit the commit history pulled by when cloning, giving a nice speedup. But in the process it broke running without the --depth parameter. The first invocation of './build --main-git' works fine, but the second falls over like so: fatal: No such remote or remote group: media_tree/master Can't update from the upstream tree at ./build line 430. The fix is to check whether that remote has been defined before trying to update from it. Signed-off-by: Vincent McIntyre --- build | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build b/build index a4cd38e..d7f51c2 100755 --- a/build +++ b/build @@ -427,8 +427,13 @@ if (@git == 2) { } } } elsif ($workdir eq "") { - system("git --git-dir media/.git remote update '$rname/$git[1]'") == 0 - or die "Can't update from the upstream tree"; + if (check_git("remote", "$rname/$git[1]")) { + system("git --git-dir media/.git remote update '$rname/$git[1]'") == 0 + or die "Can't update from the upstream tree"; + } else { + system("git --git-dir media/.git remote update origin") == 0 + or die "Can't update from the upstream tree"; + } } if ($workdir eq "") {