summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLMedia.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLMedia.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLMedia.pm22
1 files changed, 18 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm
index 260b7646cfe..1aff9af6f11 100644
--- a/Master/tlpkg/TeXLive/TLMedia.pm
+++ b/Master/tlpkg/TeXLive/TLMedia.pm
@@ -116,6 +116,7 @@ sub install_package {
# even if opt_doc is false
$real_opt_doc = 1;
}
+ my $reloc = 1 if $tlpobj->relocated;
my $container;
my @installfiles;
my $location = $self->location;
@@ -154,7 +155,7 @@ sub install_package {
} elsif (&media eq 'NET') {
$container = "$location/$Archive/$pkg.$DefaultContainerExtension";
}
- $self->_install_package($container,\@installfiles,$totlpdb) || return(0);
+ $self->_install_package($container,$reloc,\@installfiles,$totlpdb) || return(0);
# if we are installing from CD or NET we have to fetch the respective
# source and doc packages $pkg.source and $pkg.doc and install them, too
if (($media eq 'NET') || ($media eq 'CD')) {
@@ -172,12 +173,12 @@ sub install_package {
if ($container_src_split && $opt_src && $tlpobj->srcfiles) {
my $srccontainer = $container;
$srccontainer =~ s/(\.tar\.xz|\.zip)$/.source$1/;
- $self->_install_package($srccontainer,\@installfiles,$totlpdb) || return(0);
+ $self->_install_package($srccontainer,$reloc,\@installfiles,$totlpdb) || return(0);
}
if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) {
my $doccontainer = $container;
$doccontainer =~ s/(\.tar\.xz|\.zip)$/.doc$1/;
- $self->_install_package($doccontainer,\@installfiles,$totlpdb) || return(0);
+ $self->_install_package($doccontainer,$reloc,\@installfiles,$totlpdb) || return(0);
}
}
# we don't want to have wrong information in the tlpdb, so remove the
@@ -220,7 +221,7 @@ sub install_package {
# returns 1 on success and 0 on error
#
sub _install_package {
- my ($self, $what, $filelistref, $totlpdb) = @_;
+ my ($self, $what, $reloc, $filelistref, $totlpdb) = @_;
my $media = $self->media;
my $target = $totlpdb->root;
@@ -250,6 +251,8 @@ sub _install_package {
} elsif ($what =~ m,\.tar(\.xz)?$,) {
my $type = defined($1) ? "xz" : "tar";
+ $target .= "/$TeXLive::TLConfig::RelocPrefix" if $reloc;
+
# this is the case when we install from CD or the NET, or a backup
#
# in all other cases we create temp files .tar.xz (or use the present
@@ -347,6 +350,16 @@ sub remove_package {
push @files, "tlpkg/tlpobj/$pkg.doc.tlpobj";
}
#
+ # some packages might be relocated, thus having the RELOC prefix
+ # in user mode we just remove the prefix, in normal mode we
+ # replace it with texmf-dist
+ # since we don't have user mode
+ if ($tlp->relocated) {
+ for (@files) {
+ s:^$RelocPrefix/:$RelocTree/:;
+ }
+ }
+ #
# we want to check that a file is only listed in one package, so
# in case that a file to be removed is listed in another package
# we will warn and *not* remove it
@@ -360,6 +373,7 @@ sub remove_package {
my @goodfiles = ();
my @badfiles = ();
for my $f (@files) {
+ # in usermode we have to add texmf-dist again for comparison
if (defined($allfiles{$f})) {
# this file should be removed but is mentioned somewhere, too
push @badfiles, $f;