pretest: error with tlmgr and lz4 backups

Johannes Hielscher jhielscher at posteo.de
Sun Mar 3 00:18:12 CET 2019


Am Sun, 3 Mar 2019 07:31:30 +0900
schrieb Norbert Preining <preining at logic.at>:

> Hi Johannes,
> 
> thanks for checking and reporting back!
> 
> On Sat, 02 Mar 2019, Johannes Hielscher wrote:
> >          tlwarn("$0: Couldn't compress $destdir/$tarname\n");
> >          return (0,0, "");
> >        }
> > -      # make sure we remove the original tar since lc does not 
> > -      # automatically remove it
> > -      unlink("$destdir/$tarname") if (-r "$destdir/$tarname");
> > +      # make sure we remove the original tar since old lz4 versions
> > +      # cannot automatically delete it
> > +      unlink("$destdir/$tarname") if ((-r "$destdir/$tarname")
> > +                                   && (-r
> > "$destdir/$containername"));  
> 
> Immediately after this there is the code
> 	  # compute the size.
> 	  if (! -r "$destdir/$containername") {
> 	    tlwarn ("$0: Couldn't find $destdir/$containername\n");
> 	    return (0, 0, "");
> 	  }
> so a missing compressed file will be detected.
> 
> What would not unlinking help in this case? The .tar file would remain
> in the backup directory, but tlmgr does not recognizes it for restore
> purposes. Users would need to manually restore from the tar.
> 
> Furthermore, we already check for the exit code of the compressor
> program, so while I see the chance that something strange happens, I
> don't think leaving .tar files around would be helpful in these rare
> cases.

Hrm, I'm not entirely convinced. Of course those are (hopefully) rare
events (and nobody should need backups anyway). But, in case compression
failed (ll. 735ff), a mere CLI warning is displayed and the backups get
silently deleted.
Though the plain tars are of no use to tlmgr, they could at least be
more helpful than no backups at all (in case of disaster/human
interaction).
But I'm also fine with the current state, i. e. relying that our few
compressors be well-behaved in all relevant cases now.

Johannes


> 
> Best
> 
> Norbert
> 
> --
> PREINING Norbert
> http://www.preining.info Accelia Inc.     +    JAIST     +    TeX
> Live     +    Debian Developer GPG: 0x860CDC13   fp: F7D8 A928 26E3
> 16A1 9FA0 ACF0 6CAC A448 860C DC13



More information about the tex-live mailing list