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: 41572 X-Patchwork-Delegate: mchehab@kernel.org Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGMdv-0001g5-7n; Thu, 01 Jun 2017 09:43:47 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.89/mailfrontend-5) with esmtp id 1dGMdt-00059R-79; Thu, 01 Jun 2017 11:43:47 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539AbdFAJnn (ORCPT + 1 other); 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-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.6.1.93916 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' FORGED_FROM_GMAIL 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, NO_URI_HTTPS 0, __ANY_URI 0, __CD 0, __CT 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0, __YOUTUBE_RCVD 0' 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 "") {