Re: tlmgr deleted texlive-scripts
Norbert Preining <[email protected]>
| Newsgroups | gmane.comp.tex.live |
|---|---|
| Message-ID | <aQnBSZnIPAWlICQr@fettsack> |
Hi Pablo, so ... in fact there are two bugs ;-) The first is that, when you set auto_backup to 0, restore is broken. (The problem is that a pure .tar container is created but unpack fails to recognize and unpack that!) *But*, when auto_backup != 0, in your case a broken 0 byte container is created. This is strange. In your log: > D:selected compressor: C:\texlive\2025\tlpkg\installer\lz4\lz4.exe with -zfmq, on C:/texlive/2025/tlpkg/backups/texlive-scripts.r76648.tar > D:tlchecksum(C:/texlive/2025/tlpkg/backups/texlive-scripts.r76648.tar.lz4): ===18e0e2bc97aa752a47e428005084e047c3ca13ff6b146e9dc1decd653ed75f5ad0c01692ddd29e48415b1a98a83e9d7603f94d9151c36fb40bd960dfe2c314fa=== > D: done texlive-scripts.r76648.tar.lz4, size 1074479, csum 18e0e2bc97aa752a47e428005084e047c3ca13ff6b146e9dc1decd653ed75f5ad0c01692ddd29e48415b1a98a83e9d7603f94d9151c36fb40bd960dfe2c314fa We see that the backup file is **correctly** created with size 1074479 bytes and a checksum. But then, further down, you show that > 27-10-2025 19:57 0 texlive-scripts.r76648.tar.lz4 My only explanation for this is that some other Windows process is deciding that these files are eval and need to be 0-sized. I have **no** idea why and what, but this is outside of tlmgr/TeX Live happening, as far as I can see!!! ****************** I attach a patch that fixes the first, and checks whether the backup created has non-0 size, and aborts otherwise. That should at least fix the problem itself, although we don't know WHY the zero sized backup was created, as explained above. You can apply the patch by * chdir into C:\texlive\2025 * call patch -p2 --dry-run < .../path.../to/backup-fixes.patch * if that gives you some success message (or no error message), then you can do patch -p2 < .../path.../to/backup-fixes.patch After that the autobackup == 0 case should be fixed, but the other case is still a mystery. Best regards Norbert -- DI Dr Norbert Preining https://www.preining.info arXiv / Cornell University + IFMGA Guide + TU Wien + TeX Live GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13
backup-fixes.patch
(text/plain, 2 KB)
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 224003b0a47..6568c10deb5 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -3416,10 +3416,17 @@ sub action_update {
if ($opts{"backup"} && !$opts{"dry-run"}) {
my $compressorextension = $Compressors{$::progs{'compressor'}}{'extension'};
- $tlp->make_container($::progs{'compressor'}, $root,
- destdir => $opts{"backupdir"},
- relative => $tlp->relocated,
- user => 1);
+ my ($s, undef, $fullname) = $tlp->make_container($::progs{'compressor'}, $root,
+ destdir => $opts{"backupdir"},
+ relative => $tlp->relocated,
+ user => 1);
+ if ($s <= 0) {
+ tlwarn("\n$prg: creation of backup container failed for: $pkg\n");
+ tlwarn("$prg: continuing to update other packages, please retry...\n");
+ $ret |= $F_WARNING;
+ # we should try to update other packages at least
+ next;
+ }
$unwind_package =
"$opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.$compressorextension";
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 342318596a6..939f833c2d9 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2727,6 +2727,18 @@ sub unpack {
return (0, "nothing to unpack");
}
+ # Shortcut for tar file, which can only be local and are backups when
+ # auto_backup == 0
+ if ($what =~ m/\.tar$/) {
+ if (untar($what, $target, 1)) {
+ my $pkg = $what;
+ $pkg =~ s/\.tar$//;
+ return (1, "$pkg");
+ } else {
+ return (0, "untar failed");
+ }
+ }
+
my $decompressorType;
my $compressorextension;
if ($what =~ m/\.tar\.$CompressorExtRegexp$/) {