summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-08-28 10:29:01 +0900
committerNorbert Preining <norbert@preining.info>2019-10-02 12:33:49 +0900
commit863158ec2ac35ea8ee287722f678c3481d8c6f19 (patch)
tree611c7a7e72b01e22c2a3ed9483cb5def59997c6f /Master/tlpkg
parent6fe7f3475915153536579dec02406c32f82356d7 (diff)
TLPOBJ::make_container: convert arguments, pass user type as argument
convert optional arguments to hash pass add user argument to determine user created container
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm19
-rwxr-xr-xMaster/tlpkg/bin/tl-update-containers17
2 files changed, 28 insertions, 8 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 55ead17b769..7b00afe5dc2 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -559,7 +559,11 @@ sub common_texmf_tree {
sub make_container {
- my ($self,$type,$instroot,$destdir,$containername,$relative) = @_;
+ my ($self, $type, $instroot, %other) = @_;
+ my $destdir = ($other{'destdir'} || undef);
+ my $containername = ($other{'containername'} || undef);
+ my $relative = ($other{'relative'} || undef);
+ my $user = ($other{'user'} || undef);
if (!($type eq 'tar' ||
TeXLive::TLUtils::member($type, @{$::progs{'working_compressors'}}))) {
tlwarn "$0: TLPOBJ supports @{$::progs{'working_compressors'}} and tar containers, not $type\n";
@@ -638,6 +642,7 @@ sub make_container {
$containername = $tarname;
+ # OLD COMMENTS, SEE BELOW FOR CURRENT STATUS
# Here we need to distinguish between making the master containers for
# tlnet (where we can assume GNU tar) and making backups on a user's
# machine (where we can assume nothing). We determine this by whether
@@ -649,7 +654,10 @@ sub make_container {
# overflow standard tar format and result in special things being
# done. We don't want the GNU-specific special things.
#
- my $is_user_container = ( $containername =~ /\.r[0-9]/ );
+ # my $is_user_container = ( $containername =~ /\.r[0-9]/ );
+ #
+ # We use versioned containers throughout, user is determined by argument
+ my $is_user_container = $user;
my @attrs
= $is_user_container
? ()
@@ -1663,7 +1671,7 @@ if all files of the package are from the same texmf tree, this tree
is returned, otherwise an undefined value. That is also a check
whether a package is relocatable.
-=item C<make_container($type,$instroot[, $destdir[, $containername[, $relative]]])>
+=item C<make_container($type,$instroot, [ destdir => $destdir, containername => $containername, relative => 0|1, user => 0|1 ])>
creates a container file of the all files in the C<TLPOBJ>
in C<$destdir> (if not defined then C<< TLPOBJ->containerdir >> is used).
@@ -1683,7 +1691,7 @@ C<TLPOBJ> file in C<tlpkg/tlpobj/$name.tlpobj>.
The argument C<$instroot> specifies the root of the installation from
which the files should be taken.
-If the argument C<$relative> is present and true (perlish true) AND the
+If the argument C<$relative> is passed and true (perlish true) AND the
packages does not span multiple texmf trees (i.e., all the first path
components of all files are the same) then a relative packages is created,
i.e., the first path component is stripped. In this case the tlpobj file
@@ -1692,6 +1700,9 @@ is placed into the root of the installation.
This is used to distribute packages which can be installed in any arbitrary
texmf tree (of other distributions, too).
+If user is present and true, no extra arguments for container generation are
+passed to tar (to make sure that user tar doesn't break).
+
Return values are the size, the checksum, and the full name of the container.
=item C<recompute_sizes($tltree)>
diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers
index 651b477a810..bc90c0544e9 100755
--- a/Master/tlpkg/bin/tl-update-containers
+++ b/Master/tlpkg/bin/tl-update-containers
@@ -298,7 +298,10 @@ sub main {
$objcopy->clear_srcfiles;
if ($objsrc) {
my ($s,$m) = $objsrc->make_container($type, $Master,
- $opt_containerdir, "$pkg.source", $do_relative);
+ destdir => $opt_containerdir,
+ containername => "$pkg.source",
+ relative => $do_relative,
+ user => 0);
if ($s > 0) {
# something was created
# important, we have to add it to the original $obj
@@ -322,7 +325,10 @@ sub main {
$objcopy->clear_docfiles;
if ($objdoc) {
my ($s,$m) = $objdoc->make_container($type, $Master,
- $opt_containerdir, "$pkg.doc", $do_relative);
+ destdir => $opt_containerdir,
+ containername => "$pkg.doc",
+ relative => $do_relative,
+ user => 0);
if ($s > 0) {
# something was created
$obj->doccontainersize($s);
@@ -340,8 +346,11 @@ sub main {
push @removecontainers, "$pkg.doc";
}
if (!$opt_dry) {
- my ($s,$m) = $objcopy->make_container($type, $Master, $opt_containerdir,
- $pkg, $do_relative);
+ my ($s,$m) = $objcopy->make_container($type, $Master,
+ destdir => $opt_containerdir,
+ containername => $pkg,
+ relative => $do_relative,
+ user => 0);
if ($s > 0) {
$obj->containersize($s);
}