summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-containers
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/bin/tl-update-containers')
-rwxr-xr-xMaster/tlpkg/bin/tl-update-containers57
1 files changed, 42 insertions, 15 deletions
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers
index 56a62be6dbb..81a6a987ceb 100755
--- a/Master/tlpkg/bin/tl-update-containers
+++ b/Master/tlpkg/bin/tl-update-containers
@@ -24,7 +24,7 @@ use Pod::Usage;
use File::Path;
# packages matching these re's will not be updated without --all.
-my @critical_pkg_list = qw/bin-texlive texlive\.infra/;
+my @critical_pkg_list = qw/texlive\.infra/;
our ($mydir, $vc_id);
my $opt_all = 0;
@@ -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);
@@ -71,8 +72,8 @@ sub main
my $srcsplit = $tlpdb->config_src_container;
my $docsplit = $tlpdb->config_doc_container;
my $format = $tlpdb->config_container_format;
- my $type = "lzma";
- if ($format eq "lzma" || $format eq "zip") {
+ my $type = "xz";
+ if ($format eq "xz" || $format eq "zip") {
$type = $format;
} else {
tlwarn("$0: unknown container format $format in 00texlive.config; ",
@@ -176,24 +177,24 @@ sub main
}
}
- # The two packages 00texlive.config and 00texlive-installation.config
+ # The two packages 00texlive.config and 00texlive.installation
# are essential and have to be included in each and every case.
# So add them ...
my $tlpconfig = $tlpdb->get_package("00texlive.config");
$nettlpdb->add_tlpobj($tlpconfig);
- my $tlpinstconfig = $tlpdb->get_package("00texlive-installation.config");
+ my $tlpinstconfig = $tlpdb->get_package("00texlive.installation");
$nettlpdb->add_tlpobj($tlpinstconfig);
# set up the programs.
if ($opt_nosetup) {
# do a minimal setup
- $::progs{'lzma'} = "lzma";
+ $::progs{'xz'} = "xz";
$::progs{'tar'} = "tar";
} else {
# do a full setup
my $ret = &TeXLive::TLUtils::setup_programs("$Master/tlpkg/installer");
if ($ret == -1) {
- tlwarn("$0: no lzmadec for $::_platform_, aborting.\n");
+ tlwarn("$0: no xzdec for $::_platform_, aborting.\n");
exit 1;
}
if (!$ret) {
@@ -235,14 +236,36 @@ 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;
+ debug("pkg=$pkg deps_on_arch=$deps_on_arch, ctt=", defined($ctt)?$ctt:"(undefined)", "\n");
+ $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 +289,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 +308,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 +316,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;
@@ -300,7 +327,7 @@ sub main
# remove old containers
for my $op (@removecontainers) {
- if (-r "$opt_containerdir/$op.tar.lzma") {
+ if (-r "$opt_containerdir/$op.tar.xz") {
info("$0: $op container is old, removing it\n");
`rm $opt_containerdir/$op.*` unless $opt_dry;
}
@@ -349,13 +376,13 @@ sub main
# docfiles into the texlive.tlpdb, no idea why. So update should now
# do that.
$nettlpdb->save;
- system("lzma --force -k -z $opt_location/tlpkg/texlive.tlpdb");
+ system("$::progs{'xz'} --force -k -z $opt_location/tlpkg/texlive.tlpdb");
if (! @ARGV) {
# do a last check that all the containers are actually present
foreach my $p ($nettlpdb->list_packages) {
next if $p =~ /00texlive/;
- if (! -r "$opt_containerdir/$p.tar.lzma") {
+ if (! -r "$opt_containerdir/$p.tar.xz") {
tlwarn("$0: container for $p is missing, strange\n");
}
}
@@ -392,12 +419,12 @@ C<texlive.tlpdb> if need be.
=item B<-all|-a>
Include packages deemed critical in the update, currently
-C<texlive.infra> and C<bin-texlive>. (That is, C<tlmgr> itself needs
+C<texlive.infra>. (That is, C<tlmgr> itself needs
testing before updating, so we don't do it by default.)
=item B<-no-setup>
-Does not try to setup the various programs, but uses I<lzma> and I<tar>
+Does not try to setup the various programs, but uses I<xz> and I<tar>
from the current path.
=item B<-help>