diff options
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 3 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPOBJ.pm | 31 |
2 files changed, 25 insertions, 9 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index b65eef1d5e7..e4ac88bf4ef 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -927,8 +927,7 @@ and info files as specified by the options saved in the tlpdb $tlpdb->option_sys_man, $tlpdb->option_sys_info). The functions return 1 on success and 0 on error. - -On win32 it returns undefined; +On Windows it returns undefined. =cut diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index d36c2b1ea26..7a9ac657fbe 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -509,20 +509,36 @@ sub make_container { ? () : ("--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 @@ sub make_container { # cleaning up unlink("$tlpobjdir/$self->{'name'}.tlpobj"); rmdir($tlpobjdir) if $removetlpobjdir; + rmdir($tartempfile) if $tartempfile; xchdir($cwd); debug(" done $containername, size $size, $md5\n"); |