summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-08-27 10:41:22 +0200
committerKai Koehne <kai.koehne@qt.io>2018-09-13 08:53:29 +0000
commit6dfe5c31f27290973a3375461908e81ad63c3de7 (patch)
treea2e56931119a527199e1b7fc954438b7879faaa6
parente866953948d9029e29b9ca7e7b0771ed33c8d2c3 (diff)
init-repo: Resolve alternate url for git sub-submodules
Do set correct --alternates argument for sub-submodules like qtwebengine/src/3rdparty. So far these repositories were always fully cloned from remote (or the mirror). Fixes: QTBUG-61901 Change-Id: I19f5930a03ab9050b6e62ac5a5c78780d0544e03 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rwxr-xr-xinit-repository11
1 files changed, 5 insertions, 6 deletions
diff --git a/init-repository b/init-repository
index 026ac987..63972ae3 100755
--- a/init-repository
+++ b/init-repository
@@ -299,7 +299,7 @@ use constant {
sub git_clone_all_submodules
{
- my ($self, $my_repo_base, $co_branch, @subset) = @_;
+ my ($self, $my_repo_base, $co_branch, $alternates, @subset) = @_;
my %subdirs = ();
my %subbranches = ();
@@ -406,7 +406,7 @@ sub git_clone_all_submodules
foreach my $module (@modules) {
$self->git_clone_one_submodule($subdirs{$module}, $subbases{$module},
- $co_branch && $subbranches{$module});
+ $co_branch && $subbranches{$module}, $alternates);
}
if ($co_branch) {
@@ -434,7 +434,7 @@ sub git_clone_all_submodules
if (-f $module.'/.gitmodules') {
my $orig_cwd = getcwd();
chdir($module) or confess "chdir $module: $OS_ERROR";
- $self->git_clone_all_submodules($subbases{$module}, 0, "all");
+ $self->git_clone_all_submodules($subbases{$module}, 0, "$alternates/$module", "all");
chdir("$orig_cwd") or confess "chdir $orig_cwd: $OS_ERROR";
}
}
@@ -491,9 +491,8 @@ sub git_stat_one_submodule
sub git_clone_one_submodule
{
- my ($self, $submodule, $repo_basename, $branch) = @_;
+ my ($self, $submodule, $repo_basename, $branch, $alternates) = @_;
- my $alternates = $self->{ 'alternates' };
my $mirror_url = $self->{ 'mirror-url' };
my $protocol = $self->{ 'protocol' };
@@ -643,7 +642,7 @@ sub run
$url =~ s/qt5$//;
$self->{'base-url'} = $url;
- $self->git_clone_all_submodules('qt5', $self->{branch}, @{$self->{'module-subset'}});
+ $self->git_clone_all_submodules('qt5', $self->{branch}, $self->{alternates}, @{$self->{'module-subset'}});
$self->git_add_remotes('qt5');