summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPOBJ.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-23 19:45:11 +0000
committerKarl Berry <karl@freefriends.org>2009-01-23 19:45:11 +0000
commit8c684b90efa9d3d0e61b8d8136482cd7b5afc3a4 (patch)
tree3155eb5a64c9a07fd167dd8719526fc8648a3258 /Master/tlpkg/TeXLive/TLPOBJ.pm
parent73b090736899e09dcfe6482da6e1e2f3a03ebc8b (diff)
* tlprm (collapse_dirs): move to ...
* TLUtils.pm: here. * TLPOBJ.pm (make_container): call collapse_dirs to avoid too-lengthy command lines for, e.g., tex4ht. git-svn-id: svn://tug.org/texlive/trunk@11955 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPOBJ.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm26
1 files changed, 23 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 52734cc54fa..9947c43ca7e 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -515,6 +515,8 @@ sub make_container {
for my $f (@files) {
if (-f $f || -l $f) {
push(@files_to_backup, $f);
+ } elsif (! -e $f) {
+ tlwarn("$0: (make_container $containername) $f does not exist\n");
} else {
tlwarn("$0: (make_container $containername) $f not file or symlink\n");
}
@@ -532,9 +534,27 @@ sub make_container {
} 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.
+ # to pass them on stdin. Unfortunately, this can be too lengthy of
+ # a command line -- our biggest package is tex4ht, which needs about
+ # 200k. CentOS 5.2, at least, starts complaining around 140k.
+ #
+ # Therefore, if the command is likely to be too long, we call
+ # our collapse_dirs routine; in practice, this eliminates
+ # essentially all the individual files, leaving just a few
+ # directories, which is no problem. (For example, tex4ht collapses
+ # down to five directories and one file.)
+ #
+ # Although in principle we could do this in all cases, collapse_dirs
+ # isn't the most thoroughly tested function in the world. It seems
+ # safer to only do it in the (few) potentially problematic cases.
+ #
+ if (length ("@files_to_backup") > 50000) {
+ @files_to_backup = TeXLive::TLUtils::collapse_dirs(@files_to_backup);
+ # A complication, as always. collapse_dirs returns absolute paths.
+ # We want to change them back to relative so that the backup tar
+ # has the same structure.
+ s,^$instroot/,, foreach @files_to_backup;
+ }
push(@cmdline, @files_to_backup);
}