TLUtils::check_on_working_mirror creates nul file on Windows

Karl Berry karl at freefriends.org
Wed Feb 9 22:49:08 CET 2022


    when I run `tlmgr update --list --self` on Windows with recent tlmgr, a
    `nul` file appears in the working directory

Good sleuthing! I installed the following change, which tells wget to
use stdout for its log output, instead of using the "null device"
directly as the value for -O, which is presumably what is creating the
"nul" file you're seeing. Then redirect stdout to the null device, just
as we already redirect stderr.

I may rue the decision, but I'm pushing this out tonight, along with
(unrelated) workarounds for Mac cert woes. Fingers crossed. --thanks, karl.

--- TLUtils.pm	(revision 61927)
+++ TLUtils.pm	(working copy)
@@ -4176,9 +4176,9 @@
   # so try wget and only check for the return value
   # please KEEP the / after $mirror, some ftp mirrors do give back
   # an error if the / is missing after ../CTAN/
-  my $cmd = "$wget $mirror/ --timeout=$NetworkTimeout -O "
-            . (win32() ? "nul" : "/dev/null")
-            . " 2>" . (win32() ? "nul" : "/dev/null");
+  my $cmd = "$wget $mirror/ --timeout=$NetworkTimeout -O -"
+            . "  >" . (TeXLive::TLUtils::nulldev())
+            . " 2>" . (TeXLive::TLUtils::nulldev());
   my $ret = system($cmd);
   # if return value is not zero it is a failure, so switch the meanings
   return ($ret ? 0 : 1);


More information about the tex-live mailing list.