summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 7ec02aee354..657754827fd 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -7065,7 +7065,9 @@ sub setup_one_remotetlpdb {
# first check that the saved tlpdb is present at all
my $loc_digest = TeXLive::TLCrypto::tl_short_digest($location);
my $loc_copy_of_remote_tlpdb =
- "$Master/$InfraLocation/texlive.tlpdb.$loc_digest";
+ ($is_main ?
+ "$Master/$InfraLocation/texlive.tlpdb.main.$loc_digest" :
+ "$Master/$InfraLocation/texlive.tlpdb.$loc_digest");
ddebug("loc_digest = $loc_digest\n");
ddebug("loc_copy = $loc_copy_of_remote_tlpdb\n");
if (-r $loc_copy_of_remote_tlpdb) {
@@ -7229,7 +7231,9 @@ FROZEN
if (!$local_copy_tlpdb_used && $location =~ m;^(https?|ftp)://;) {
my $loc_digest = TeXLive::TLCrypto::tl_short_digest($location);
my $loc_copy_of_remote_tlpdb =
- "$Master/$InfraLocation/texlive.tlpdb.$loc_digest";
+ ($is_main ?
+ "$Master/$InfraLocation/texlive.tlpdb.main.$loc_digest" :
+ "$Master/$InfraLocation/texlive.tlpdb.$loc_digest");
my $tlfh;
if (!open($tlfh, ">:unix", $loc_copy_of_remote_tlpdb)) {
# that should be only a debug statement, since a user without
@@ -7240,6 +7244,14 @@ FROZEN
&debug("writing out tlpdb to $loc_copy_of_remote_tlpdb\n");
$remotetlpdb->writeout($tlfh);
close($tlfh);
+ # Remove all other copies of main databases in case different mirrors
+ # are used $Master/$InfraLocation/texlive.tlpdb.main.$loc_digest
+ if ($is_main) {
+ for my $fn (<"$Master/$InfraLocation/texlive.tlpdb.main.*">) {
+ next if ($fn eq $loc_copy_of_remote_tlpdb);
+ unlink($fn);
+ }
+ }
}
}