diff options
Diffstat (limited to 'Master/tlpkg/bin/tl-update-containers')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-containers | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index 2f1cb1b9d4b..e5c7376bd14 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -43,6 +43,7 @@ GetOptions( "location=s" => \$opt_location, "no-setup" => \$opt_nosetup, "recreate" => \$opt_recreate, + "relative" => \$opt_relative, "version" => \$opt_version, "help|?" => \$opt_help) or pod2usage(1); @@ -235,14 +236,35 @@ sub main debug("updating $pkg containers ...\n"); # we have to make a copy otherwise the src/doc files in the original # tlpobj are removed, and thus also in the tlpdb to be saved!!! + my $objcopy = $obj->copy; + + # if we try to create relative containers we check the package + # for residing only in texmf-dist, and being relocatable, and + # not having a dependency on $pkg.ARCH + # TLPOBJ->common_texmf_tree returns the string of the + # common temxf tree or undefined, so we can use it in && + my $ctt = $objcopy->common_texmf_tree; + my $deps_on_arch = 0; + for ($objcopy->depends) { + if (m/^$pkg\.ARCH$/) { + $deps_on_arch = 1; + last; + } + } + my $do_relative = 0; + $do_relative = $opt_relative && # user option + ($deps_on_arch?0:1) && # no $pkg.ARCH dep + (defined($ctt)?1:0) && # see above + (($ctt eq $TeXLive::TLConfig::RelocTree) ? 1 : 0); + # only for texmf-dist if ($srcsplit) { if (!$opt_dry) { my $objsrc = $obj->srcfiles_package; $objcopy->clear_srcfiles; if ($objsrc) { my ($s,$m) = $objsrc->make_container($type, $Master, $opt_containerdir, - "$pkg.source", $opt_relative); + "$pkg.source", $do_relative); if ($s > 0) { # something was created # important, we have to add it to the original $obj @@ -266,7 +288,7 @@ sub main $objcopy->clear_docfiles; if ($objdoc) { my ($s,$m) = $objdoc->make_container($type, $Master, - $opt_containerdir, "$pkg.doc", $opt_relative); + $opt_containerdir, "$pkg.doc", $do_relative); if ($s > 0) { # something was created $obj->doccontainersize($s); @@ -285,7 +307,7 @@ sub main } if (!$opt_dry) { my ($s,$m) = $objcopy->make_container($type, $Master, $opt_containerdir, - $pkg, $opt_relative); + $pkg, $do_relative); if ($s > 0) { $obj->containersize($s); } @@ -293,6 +315,10 @@ sub main $obj->containermd5($m); } } + # if the container has been build relocatable we save that information + $obj->relocated($do_relative); + # and remove the common prefix from the files in the tlpobj + $obj->cancel_common_texmf_tree if $do_relative; # add the updated (or new) TLPOBJ to NET TLPDB # that way the other container sizes are not destroyed $nettlpdb->add_tlpobj($obj) unless $opt_dry; |