diff options
-rwxr-xr-x | init-repository | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/init-repository b/init-repository index c324eef6..b874af3a 100755 --- a/init-repository +++ b/init-repository @@ -194,6 +194,8 @@ For example: user@machine:/foo/bar/qtbase.git +The mirror is permitted to contain a subset of the submodules; any +missing modules will fall back to the canonical URLs. =item --mirror-webkit <url> @@ -581,6 +583,13 @@ sub git_clone_one_submodule $mirror =~ s/qtsoftware/gitorious/ ; } + # Only use the mirror if it can be reached. + eval { $self->exe('git', 'ls-remote', $mirror, 'test/if/mirror/exists') }; + if ($@) { + warn "mirror [$mirror] is not accessible; $url will be used\n"; + undef $mirror; + } + my $do_clone = (! -d "$submodule/.git"); if ($do_clone) { $self->exe('git', 'clone', @reference_args, ($mirror ? $mirror : $url), $submodule); |