[tex-live] Can't spawn "cmd.exe": No such file or directory at F:/TeXLive/2008/tlpkg/TeXLive/TLUtils.pm line 459.

Karl Berry karl at freefriends.org
Wed Dec 24 20:13:04 CET 2008


Thanks.  I committed the following change to TLPOBJ.pm.  I have no way
to test it on Windows, though.  Maybe someone can try it out today and
I'll push it to tlnet tonight?  (Otherwise it will be in tlcritical
tonight, anyway.)

karl

--- TLPOBJ.pm	(revision 11703)
+++ TLPOBJ.pm	(working copy)
@@ -509,20 +509,36 @@
               ? () : ("--owner", "0", "--group", "0");
   my @cmdline = ($tar, "-cf", "$destdir/$tarname", @attrs);
   
-  # Get list of files.  We have to pass them all on the command line,
-  # because there is no portable way to pass them on stdin.  This can be
-  # a lengthy command line, but modern systems have enough argv space.
-  # our biggest package is tex4ht, which needs about 200k.
+  # Get list of files and symlinks to back up.  Nothing else should be
+  # in the list.
+  my @files_to_backup = ();
   for my $f (@files) {
     if (-f $f || -l $f) {
-      push(@cmdline, $f);
+      push(@files_to_backup, $f);
     } else {
       tlwarn("$0: (make_container $containername) $f not file or symlink\n");
     }
   }
+  
+  my $tartempfile = "";
+  if (win32()) {
+    # Since we provide our own (GNU) tar on Windows, we know it has -T.
+    my $tmpdir = TeXLive::TLUtils::get_system_tmpdir();
+    $tartempfile = "$tmpdir/mc$$";
+    open(TMP, ">$tartempfile") || die "open(>$tartempfile) failed: $!";
+    print TMP map { "$_\n" } @files_to_backup;
+    close(TMP) || warn "close(>$tartempfile) failed: $!";
+    push(@cmdline, "-T", $tartempfile);
+  } else {
+    # For Unix, we pass all the files on the command line, because there
+    # is no portable (across different platforms and different tars)  way
+    # to pass them on stdin.  This can be a lengthy command line, but
+    # modern systems have enough argv space -- our biggest package is
+    # tex4ht, which needs about 200k.
+    push(@cmdline, @files_to_backup);
+  }
 
-  # create tar file.
-  # unlink both here in case the container is also the plain tar.
+  # Run tar. Unlink both here in case the container is also plain tar.
   unlink("$destdir/$tarname");
   unlink("$destdir/$containername");
   xsystem(@cmdline);
@@ -548,6 +564,7 @@
   # cleaning up
   unlink("$tlpobjdir/$self->{'name'}.tlpobj");
   rmdir($tlpobjdir) if $removetlpobjdir;
+  rmdir($tartempfile) if $tartempfile;
   xchdir($cwd);
 
   debug(" done $containername, size $size, $md5\n");


More information about the tex-live mailing list