diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-08-15 21:42:41 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-09-23 20:29:01 +0200 |
commit | 485f5f377614dfd361992d432b161d69a65e0861 (patch) | |
tree | 7fe17ed737e70a99d1852e29085135489507b028 /init-repository | |
parent | 4553d9ec11308b5de5cfda5dc2deef1d68b09ff1 (diff) | |
download | qt5-485f5f377614dfd361992d432b161d69a65e0861.tar.gz |
don't pass around url unnecessarily
we now have everything we need to construct it on the fly.
Change-Id: I129e49bbcf46428d0fcef31ab8188df9d6a4026c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'init-repository')
-rwxr-xr-x | init-repository | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/init-repository b/init-repository index 45567c3c..985d042a 100755 --- a/init-repository +++ b/init-repository @@ -390,14 +390,16 @@ sub git_clone_all_submodules } } + my @modules = sort keys %include; + $self->git_submodule_init; # manually clone each repo here, so we can easily use reference repos, mirrors etc my @configresult = qx(git config -l); foreach my $line (@configresult) { # Example line: submodule.qtqa.url=git://gitorious.org/qt/qtqa.git - next if ($line !~ /submodule\.([^.=]+)\.url=(.*)/); - my ($module, $url) = ($1, $2); + next if ($line !~ /submodule\.([^.=]+)\.url=/); + my $module = $1; if (!defined($include{$module})) { $self->exe('git', 'config', '--remove-section', "submodule.$module"); @@ -407,8 +409,10 @@ sub git_clone_all_submodules if ($self->{'ignore-submodules'}) { $self->exe('git', 'config', "submodule.$module.ignore", 'all'); } + } - $self->git_clone_one_submodule($subdirs{$module}, $subbases{$module}, $url); + foreach my $module (@modules) { + $self->git_clone_one_submodule($subdirs{$module}, $subbases{$module}); if ($module eq "qtwebengine") { $self->exe('git', 'submodule', 'update', $module); my $orig_cwd = getcwd(); @@ -447,7 +451,7 @@ sub git_add_remotes sub git_clone_one_submodule { - my ($self, $submodule, $repo_basename, $url) = @_; + my ($self, $submodule, $repo_basename) = @_; my $alternates = $self->{ 'alternates' }; my $mirror_url = $self->{ 'mirror-url' }; @@ -466,9 +470,10 @@ sub git_clone_one_submodule } } + my $url = $self->{'base-url'}.$repo_basename; my $mirror; - if ($mirror_url and $url =~ /\/(qt\/[^.]+)\.git/) { - $mirror = $mirror_url.$1; + if ($mirror_url) { + $mirror = $mirror_url.$repo_basename; $mirror .= ".git" unless (-d $mirror); # Support local disk mirror } @@ -558,6 +563,12 @@ sub run $self->check_if_already_initialized; + chomp(my $url = `git config remote.origin.url`); + die("Have no origin remote.\n") if (!$url); + $url =~ s,\.git$,,; + $url =~ s,qt/qt5$,,; + $self->{'base-url'} = $url; + $self->git_clone_all_submodules('qt/qt5', @{$self->{'module-subset'}}); $self->git_add_remotes('qt/qt5'); |