Commit 4f435722 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Make `sync-all remote set-url` use normalized `/packages/` urls

A simple heuristic (i.e. replacing the `libraries/` suffix by
`packages/` in the inferred remotepath, if the remotepath in the
`packages` file is "-") used to infer the remotepath for Git
submodules. A proper solution would require to parse the `.gitmodules`
file to obtain the actual localpath<->remotepath mapping.

This addresses #8121 and is a follow-up to a22e908a which changed the
`.gitmodules` urls to use the `/packages/` folder instead of
`/libraries/`.
parent a22e908a
......@@ -455,7 +455,16 @@ sub gitall {
my $rpath;
$ignore_failure = 1;
if ($remotepath eq '-') {
$rpath = "$repo_base/$localpath";
$rpath = "$localpath.git"; # N.B.: $localpath lacks the .git suffix
if ($localpath =~ /^libraries\//) {
# FIXME: This is just a simple heuristic to
# infer the remotepath for Git submodules. A
# proper solution would require to parse the
# .gitmodules file to obtain the actual
# localpath<->remotepath mapping.
$rpath =~ s/^libraries\//packages\//;
}
$rpath = "$repo_base/$rpath";
} else {
$rpath = $path;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment