aboutsummaryrefslogtreecommitdiffstats
path: root/init-repository
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-08-11 10:30:41 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-11 12:51:11 +0200
commit38e02c6434ef7bc29c38a2139db2595031414440 (patch)
treec20d2740689501b805373bc64aacc7f9f24c61b3 /init-repository
parent874e0ca4b74a4c22c92bab37bb3da01c38c4e08c (diff)
init-repository: let `--http' option also work for v8
Useful for people behind restrictive firewalls. Task-number: QTBUG-20837 Change-Id: I1c6845ceb3b9ba17a0e36c97838a73ed94aa11f2 Reviewed-on: http://codereview.qt.nokia.com/2831 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'init-repository')
-rwxr-xr-xinit-repository27
1 files changed, 21 insertions, 6 deletions
diff --git a/init-repository b/init-repository
index d01e314c..1a3e332e 100755
--- a/init-repository
+++ b/init-repository
@@ -566,6 +566,7 @@ sub git_clone_one_submodule
my $mirror_url = $self->{ 'mirror-url' };
my $mirror_webkit_url = $self->{ 'mirror-webkit-url' };
my $mirror_v8_url = $self->{ 'mirror-v8-url' };
+ my $protocol = $self->{ 'protocol' };
# `--reference FOO' args for the clone, if any.
my @reference_args;
@@ -628,7 +629,7 @@ sub git_clone_one_submodule
if ($submodule eq "qtdeclarative") { #Extra step needed to setup declarative
$self->exe('git', 'submodule', 'init');
- if ($do_clone and $mirror_v8_url) {
+ if ($mirror_v8_url || $protocol eq 'http') {
my @configresult = qx(git config -l);
my $v8url;
foreach my $line (@configresult) {
@@ -636,11 +637,25 @@ sub git_clone_one_submodule
next if ($line !~ /submodule.src\/3rdparty\/v8.url=(.*)/);
$v8url = $1;
}
- chdir('src/3rdparty/') or confess "chdir $submodule/src/3rdparty: $OS_ERROR";
- $self->exe('git', 'clone', $mirror_v8_url, 'v8');
- chdir('v8') or confess "chdir $submodule/src/3rdparty/v8: $OS_ERROR";
- $self->exe('git', 'config', 'remote.origin.url', $v8url);
- chdir('../../..') or confess "cd ../../..: $OS_ERROR";
+
+ if ($protocol eq 'http') {
+ # rewrite the git:// url to https://
+ if ($v8url =~ s{^git://github}{https://github}) {
+ $self->exe('git', 'config', 'submodule.src/3rdparty/v8.url', $v8url);
+ }
+ else {
+ warn 'You requested git over http, but I could not figure out how to '
+ ."rewrite v8's giturl of $v8url";
+ }
+ }
+
+ if ($mirror_v8_url && $do_clone) {
+ chdir('src/3rdparty/') or confess "chdir $submodule/src/3rdparty: $OS_ERROR";
+ $self->exe('git', 'clone', $mirror_v8_url, 'v8');
+ chdir('v8') or confess "chdir $submodule/src/3rdparty/v8: $OS_ERROR";
+ $self->exe('git', 'config', 'remote.origin.url', $v8url);
+ chdir('../../..') or confess "cd ../../..: $OS_ERROR";
+ }
}
$self->exe('git', 'submodule', 'update');
}