From: Vincent McIntyre <vincent.mcintyre@gmail.com>
To: linux-media@vger.kernel.org
Subject: [patch] [media_build] Small fix to build script (resend)
Date: Sat, 10 Jun 2017 12:08:40 +1000 [thread overview]
Message-ID: <20170610020838.GA12764@ubuntu.windy> (raw)
This seems to have fallen on the floor...
Original send date: Thu, 1 Jun 2017 19:43:43 +1000
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 <vincent.mcintyre@gmail.com>
---
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 "") {
reply other threads:[~2017-06-10 2:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170610020838.GA12764@ubuntu.windy \
--to=vincent.mcintyre@gmail.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox