summaryrefslogtreecommitdiff
path: root/Master/tlpkg/dev
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-12-30 04:37:57 +0000
committerNorbert Preining <preining@logic.at>2009-12-30 04:37:57 +0000
commit5664d6ec4cf4fbb0fae9f4b01622d282528427d1 (patch)
tree46377ecebd39e3c6c6f192c7f76ceddc6ecbe3e2 /Master/tlpkg/dev
parent9149a13306d8974d532e808fbab2ef3e5cc07243 (diff)
update usermode tlmgr patch
git-svn-id: svn://tug.org/texlive/trunk@16528 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/dev')
-rw-r--r--Master/tlpkg/dev/dev.usermode-tlmgr.patch441
1 files changed, 277 insertions, 164 deletions
diff --git a/Master/tlpkg/dev/dev.usermode-tlmgr.patch b/Master/tlpkg/dev/dev.usermode-tlmgr.patch
index ba3a85122dd..0704e58af0c 100644
--- a/Master/tlpkg/dev/dev.usermode-tlmgr.patch
+++ b/Master/tlpkg/dev/dev.usermode-tlmgr.patch
@@ -1,133 +1,17 @@
-Index: tlpkg/TeXLive/TLConfig.pm
-===================================================================
---- tlpkg/TeXLive/TLConfig.pm (revision 15374)
-+++ tlpkg/TeXLive/TLConfig.pm (working copy)
-@@ -169,7 +169,8 @@
-
- our %TLPDBSettings = (
- "platform" => [ "s", "Main platform for this computer" ],
-- "available_architectures" => [ "l", "All available/installed architectures" ]
-+ "available_architectures" => [ "l", "All available/installed architectures" ],
-+ "usertree" => [ "b", "This tree acts as user tree" ]
- );
-
- our $WindowsMainMenuName = "TeX Live $ReleaseYear";
-Index: tlpkg/TeXLive/TLPOBJ.pm
-===================================================================
---- tlpkg/TeXLive/TLPOBJ.pm (revision 15374)
-+++ tlpkg/TeXLive/TLPOBJ.pm (working copy)
-@@ -458,6 +458,21 @@
- sub cancel_reloc_prefix {
- my $self = shift;
- my @docfiles = $self->docfiles;
-+ for (@docfiles) { s:^$RelocPrefix/::; }
-+ $self->docfiles(@docfiles);
-+ my @runfiles = $self->runfiles;
-+ for (@runfiles) { s:^$RelocPrefix/::; }
-+ $self->runfiles(@runfiles);
-+ my @srcfiles = $self->srcfiles;
-+ for (@srcfiles) { s:^$RelocPrefix/::; }
-+ $self->srcfiles(@srcfiles);
-+ # if there are bin files they have definitely NOT the
-+ # texmf-dist prefix, so we cannot cancel it anyway
-+}
-+
-+sub replace_reloc_prefix {
-+ my $self = shift;
-+ my @docfiles = $self->docfiles;
- for (@docfiles) { s:^$RelocPrefix/:$RelocTree/:; }
- $self->docfiles(@docfiles);
- my @runfiles = $self->runfiles;
-Index: tlpkg/TeXLive/TLMedia.pm
-===================================================================
---- tlpkg/TeXLive/TLMedia.pm (revision 15374)
-+++ tlpkg/TeXLive/TLMedia.pm (working copy)
-@@ -60,6 +60,8 @@
- }
- if (-d "$location/texmf/web2c") {
- $media = 'DVD';
-+ } elsif (-d "$location/web2c") {
-+ $media = 'DVD';
- } elsif (-d "$location/$Archive") {
- $media = 'CD';
- } else {
-@@ -247,8 +249,12 @@
- }
- # if a package is relocatable we have to cancel the reloc prefix
- # before we save it to the local tlpdb
-- if ($tlpobj->relocated) {
-- $tlpobj->cancel_reloc_prefix;
-+ if ($reloc) {
-+ if ($totlpdb->setting("usertree")) {
-+ $tlpobj->cancel_reloc_prefix;
-+ } else {
-+ $tlpobj->replace_reloc_prefix;
-+ }
- }
- # we have to write out the tlpobj file since it is contained in the
- # archives (.tar.xz) but at DVD install time we don't have them
-@@ -317,7 +323,11 @@
- } elsif ($what =~ m,\.tar(\.xz)?$,) {
- my $type = defined($1) ? "xz" : "tar";
-
-- $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
-+ if ($reloc) {
-+ if (!$totlpdb->setting("usertree")) {
-+ $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
-+ }
-+ }
-
- # this is the case when we install from CD or the NET, or a backup
- #
-@@ -400,6 +410,7 @@
- my ($self, $pkg, $nopostinstall) = @_;
- my $localtlpdb = $self->tlpdb;
- my $tlp = $localtlpdb->get_package($pkg);
-+ my $usertree = $localtlpdb->setting("usertree");
- if (!defined($tlp)) {
- tlwarn ("$pkg: package not present, cannot remove\n");
- } else {
-@@ -426,9 +437,12 @@
- # 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/:;
-+ if (!$usertree) {
-+ s:^$RelocPrefix/:$RelocTree/:;
-+ }
- }
- }
- #
-Index: tlpkg/TeXLive/TLUtils.pm
-===================================================================
---- tlpkg/TeXLive/TLUtils.pm (revision 15374)
-+++ tlpkg/TeXLive/TLUtils.pm (working copy)
-@@ -1237,7 +1237,7 @@
- # if a package is relocatable we have to cancel the reloc prefix
- # before we save it to the local tlpdb
- if ($tlpobj->relocated) {
-- $tlpobj->cancel_reloc_prefix;
-+ $tlpobj->replace_reloc_prefix;
- }
- $totlpdb->add_tlpobj($tlpobj);
- # we have to write out the tlpobj file since it is contained in the
Index: texmf/scripts/texlive/tlmgr.pl
===================================================================
---- texmf/scripts/texlive/tlmgr.pl (revision 15374)
+--- texmf/scripts/texlive/tlmgr.pl (revision 16521)
+++ texmf/scripts/texlive/tlmgr.pl (working copy)
-@@ -123,6 +123,8 @@
- "machine-readable" => 1,
+@@ -127,6 +127,8 @@
"package-logfiles" => "=s",
+ "persistent-downloads" => 1,
"pause" => 1,
+ "usermode" => 1,
+ "usertree" => "=s",
"version" => 1,
"help|h|?" => 1);
-@@ -296,13 +298,30 @@
+@@ -305,13 +307,30 @@
pod2usage(-msg => $msg, -exitstatus => 1, -verbose => 1, @noperldoc);
}
@@ -159,7 +43,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
#
# Try to open the packagelog file, but do NOT die when that does not work
if (!open(PACKAGELOG, ">>$packagelogfile")) {
-@@ -438,6 +457,9 @@
+@@ -457,6 +476,9 @@
} elsif ($action =~ m/^show$/i) {
action_show();
finish(0);
@@ -169,7 +53,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
} elsif ($action =~ m/^remove$/i) {
action_remove();
} elsif ($action =~ /^paper$/) {
-@@ -499,6 +521,8 @@
+@@ -520,6 +542,8 @@
{
my $errors = 0;
@@ -178,7 +62,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
if ($::files_changed) {
$errors += do_cmd_and_check("mktexlsr");
$::files_changed = 0;
-@@ -529,14 +553,14 @@
+@@ -550,14 +574,14 @@
}
}
for my $m (keys %do_disable) {
@@ -196,7 +80,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
}
-@@ -581,13 +605,13 @@
+@@ -602,13 +626,13 @@
# first regenerate all formats --byengine
for my $e (keys %updated_engines) {
log ("updating formats based on $e\n");
@@ -212,7 +96,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
$done_formats{$f} = 1;
}
}
-@@ -625,7 +649,7 @@
+@@ -646,7 +670,7 @@
$lang = "$TEXMFSYSVAR/tex/generic/config/$lang";
}
if ($localtlpdb->option("create_formats") && !$::regenerate_all_formats) {
@@ -221,7 +105,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
}
}
}
-@@ -634,7 +658,7 @@
+@@ -655,7 +679,7 @@
#
if ($::regenerate_all_formats) {
info("Regenerating all formats, this may take some time ...");
@@ -230,7 +114,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
info("done\n");
$::regenerate_all_formats = 0;
}
-@@ -807,8 +831,13 @@
+@@ -828,8 +852,13 @@
action_gui("config") if $opts{"gui"};
init_local_db();
@@ -246,7 +130,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
my $action = shift @ARGV;
if ($action =~ m/^paper$/i) { # generic paper
-@@ -820,7 +849,7 @@
+@@ -841,7 +870,7 @@
"as in: tlmgr pdftex paper --list\n");
} elsif (!defined($newpaper)) { # tlmgr paper => show all current sizes.
@@ -255,7 +139,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
} elsif ($newpaper !~ /^(a4|letter)$/) { # tlmgr paper junk => complain.
$newpaper = "the empty string" if !defined($newpaper);
-@@ -828,7 +857,7 @@
+@@ -849,7 +878,7 @@
} else { # tlmgr paper {a4|letter} => do it.
return if !check_on_writable();
@@ -264,38 +148,24 @@ Index: texmf/scripts/texlive/tlmgr.pl
}
} else { # program-specific paper
-@@ -845,7 +874,7 @@
- if (@ARGV) {
+@@ -866,7 +895,7 @@
return if !check_on_writable();
}
+ unshift(@ARGV, "--list") if $opts{"list"};
- TeXLive::TLPaper::do_paper($prog,$texmfsysconfig,@ARGV);
+ TeXLive::TLPaper::do_paper($prog,$texmfconfig,@ARGV);
}
}
-@@ -886,13 +915,14 @@
- # include arbitrary package in the list of collections, but
- # only collectons:
- @colls = grep {m;^collection-;} @colls;
-- print "package: ", $tlp->name, "\n";
-- print "category: ", $tlp->category, "\n";
-- print "shortdesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc);
-- print "longdesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc);
-- print "installed: ", ($installed ? "Yes" : "No"), "\n";
-- print "revision: ", $tlp->revision, "\n" if ($installed);
-- print "collection: ", @colls, "\n" if (@colls);
-+ print "package: ", $tlp->name, "\n";
-+ print "category: ", $tlp->category, "\n";
-+ print "shortdesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc);
-+ print "longdesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc);
-+ print "installed: ", ($installed ? "Yes" : "No"), "\n";
-+ print "revision: ", $tlp->revision, "\n" if ($installed);
+@@ -913,6 +942,7 @@
+ print "longdesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc);
+ print "installed: ", ($installed ? "Yes" : "No"), "\n";
+ print "revision: ", $tlp->revision, "\n" if ($installed);
+ print "relocatable: ", ($tlp->relocated ? "Yes" : "No"), "\n";
-+ print "collection: ", @colls, "\n" if (@colls);
- if ($opts{"list"}) {
- if ($tlp->category eq "Collection" || $tlp->category eq "Scheme") {
- # in the case of collections of schemes we list the deps
-@@ -956,6 +986,10 @@
+ print "cat-version: ", $tlp->cataloguedata->{'version'}, "\n"
+ if $tlp->cataloguedata->{'version'};
+ print "cat-date: ", $tlp->cataloguedata->{'date'}, "\n"
+@@ -983,6 +1013,10 @@
# PATH
#
sub action_path {
@@ -306,7 +176,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
my $what = shift @ARGV;
if (!defined($what) || ($what !~ m/^(add|remove)$/i)) {
tlwarn("action path needs one argument, either add or remove\n");
-@@ -1664,7 +1698,10 @@
+@@ -1691,7 +1725,10 @@
# check for updates to tlmgr and die unless either --force or --list or --self
# is given
@@ -318,7 +188,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
my $dry_run_cont = $opts{"dry-run"} && ($opts{"dry-run"} < 0);
if ( !$dry_run_cont && !$opts{"self"} && @critical) {
critical_updates_warning();
-@@ -2412,16 +2449,18 @@
+@@ -2465,16 +2502,18 @@
init_tlmedia();
# check for updates to tlmgr itself, and die unless --force is given
@@ -346,7 +216,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
}
}
}
-@@ -2434,7 +2473,7 @@
+@@ -2487,7 +2526,7 @@
@packs = $tlmediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @ARGV) unless $opts{"no-depends-at-all"};
# now expand all others unless $opts{"no-depends"}
# if $opts{"reinstall"} do not collection->collection dependencies
@@ -355,7 +225,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
@packs = $tlmediatlpdb->expand_dependencies("-no-collections", $localtlpdb, @packs) unless $opts{"no-depends"};
} else {
@packs = $tlmediatlpdb->expand_dependencies($localtlpdb, @packs) unless $opts{"no-depends"};
-@@ -2502,6 +2541,15 @@
+@@ -2555,6 +2594,15 @@
foreach my $pkg (@todo) {
my $flag = $FLAG_INSTALL;
my $re = "";
@@ -371,7 +241,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
if (defined($localtlpdb->get_package($pkg))) {
if ($opts{"reinstall"}) {
$re = "re";
-@@ -2730,11 +2778,11 @@
+@@ -2784,11 +2832,11 @@
# now also save the TLPOBJ of 00texlive.installation
my $tlpo = $localtlpdb->get_package("00texlive.installation");
if ($tlpo) {
@@ -385,9 +255,9 @@ Index: texmf/scripts/texlive/tlmgr.pl
}
}
} else {
-@@ -2766,6 +2814,10 @@
- if ($^O=~/^MSWin(32|64)$/i) {
+@@ -2821,6 +2869,10 @@
warn("action `arch' not supported on Windows\n");
+ return();
}
+ if ($opts{"usermode"}) {
+ tlwarn("action `arch' not supported in usermode\n");
@@ -396,7 +266,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
if ($opts{"gui"}) {
action_gui("arch");
}
-@@ -2899,6 +2951,10 @@
+@@ -2960,6 +3012,10 @@
# GENERATE
#
sub action_generate {
@@ -407,7 +277,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
my $dest = defined($opts{"dest"}) ? $opts{"dest"} : "";
my $localconf = defined($opts{"localcfg"}) ? $opts{"localcfg"} : "";
my $what = shift @ARGV;
-@@ -3708,6 +3764,38 @@
+@@ -3774,6 +3830,39 @@
#
@@ -439,6 +309,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
+ # we need to create web2c dir for TLMedia to succeed setting up
+ # and for tlmgr.log file
+ mkdir ("$usertree/web2c");
++ mkdir ("$usertree/tlpkg/tlpobj");
+}
+
+
@@ -446,7 +317,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
# action conf
# tries to mimick texconfig conf but probably will add some more things
#
-@@ -3771,10 +3859,10 @@
+@@ -3837,10 +3926,10 @@
# stuff changed via the GUI
return if defined $localtlmedia;
return if defined $localtlpdb;
@@ -460,7 +331,7 @@ Index: texmf/scripts/texlive/tlmgr.pl
# setup the programs, for w32 we need the shipped wget/xz etc, so we
# pass the location of these files to setup_programs.
if (!setup_programs("$Master/tlpkg/installer", $localtlmedia->platform)) {
-@@ -4082,6 +4170,7 @@
+@@ -4152,6 +4241,7 @@
}
sub check_on_writable {
@@ -468,3 +339,245 @@ Index: texmf/scripts/texlive/tlmgr.pl
if (!TeXLive::TLUtils::dir_writable("$Master/tlpkg")) {
tlwarn("You don't have permission to change the installation in any way,\n");
tlwarn("specifically, the directory $Master/tlpkg/ is not writable.\n");
+@@ -4305,6 +4395,15 @@
+ likely untranslated, messages to standard error. Helpful for
+ translators to see what remains to be done.
+
++=item B<--usermode>
++
++Activates the user mode, see L<USER MODE> below.
++
++=item B<--usertree> I<dir>
++
++Uses I<dir> as user tree in user mode, seel L<USER MODE> below.
++
++
+ =back
+
+ The standard options for TeX Live programs are also accepted:
+@@ -5061,8 +5160,109 @@
+ to make use of C<updmap-local.cfg>, you need to run C<tlmgr generate
+ updmap> yourself. After that, network updates and your local changes
+ should be merged.
++
++=head2 init-usertree
+
++sets up the default user tree (C<TEXMFHOME>) or the one specified
++on the command line using C<--usertree> for user mode management.
++See L<USER MODE> below.
+
++
++=head1 USER MODE
++
++B<WARNING> B<WARNING> B<WARNING>
++This is very much work in progress
++and experimental. Expect breakage, and the need to reinstall your
++user tree a new.
++
++C<tlmgr> provides a restricted way to manage arbitrary texmf trees
++in the same way as the installation. This allows a user without write
++permissions to the installation location to update/install packages
++into a user tree.
++
++C<tlmgr> is set into user mode by giving the command line option
++C<--usermode>. It will not switch automatically, nor does it support
++a config file by now. Thus, this option has to be given every time.
++
++This mode of C<tlmgr> works on a user tree, which by default will be
++the value of C<TEXMFHOME>, but can be overridden with the command line
++option C<--usertree>. In the following when we speak of the user tree
++we mean either C<TEXMFHOME> or the one given on the command line.
++
++Not all actions are allowed in user mode, C<tlmgr> will warn you and
++not carry out this action. The actions of C<tlmgr> can be classified into
++those that don't need write permissions and thus are working the same
++in user mode or normal mode. Currently these are
++B<help>, B<version>, B<search>, B<show>, B<list>, B<check>, B<print-arch>.
++
++Most of the actions dealing with package management on the other hand
++need write permissions, and behave differently:
++B<install>, B<update>, B<remove>, B<option>, B<paper>, B<generate>,
++B<backup>, B<restore>, B<uninstall>, B<symlinks>.
++
++Currently not supported (and probably will never be) is the B<arch>
++action.
++
++As for the B<gui> action it is currently not supported, but might be
++in future.
++
++Before using C<tlmgr> in user mode, you have to set up the user tree
++with the B<init-usertree> action. This will create C<USERTREE/web2c>,
++C<USERTREE/tlpkg/tlpobj> and set up a minimal C<USERTREE/tlpkg/texlive.tlpdb>.
++From then on you can use the supported actions as normal by adding
++the C<--usermode> command line switch.
++
++In user mode the file C<USERTREE/tlpkg/texlive.tlpdb> contains only the
++packages that have been installed into the user tree C<USERTREE> using
++C<tlmgr>, plus additional options in the virtual package
++00texlive.installation (like with the main installation's texlive.tlpdb).
++
++All actions on packages in user mode can only be carried out on packages
++that are marked as B<relocatable>. Basically that means that the contained
++files all reside in the C<texmd-dist> tree. B<NOTE> That already excludes
++all binary packages! Of the currently about 1900 packages the majority,
++currently about 1750, are relocatable, i.e., they can be installed into
++a user tree.
++
++Description of changes of actions in user mode:
++
++=head2 install
++
++in usermode the tlmgr action install will check that the package
++and all depending packages are either all relocated, or those that
++are not relocated are already installed in the system installation.
++If this is true it will unpack all containers to be installed into
++the user tree (TEXMFHOME or the value of --user-tree) and add the
++respective packages to the user texlive.tlpdb (creating it if there
++has non be created till now).
++
++Currently installing a collection installs all depending packages,
++but in contrast to normal mode does not install depending collections.
++So in *normal* mode tlmgr install collection-context would install
++collection-metapost, c-basic, c-documentation-base, too. In *usermode*
++only the packages mentioned in collection-context are installed.
++
++=head2 backup, restore, remove, update
++
++in usermode the tlmgr action update will check that all packages
++to be updated are installed in the user tree, otherwise it behaves
++exactely like the system tlmgr.
++
++=head2 option
++
++only acts upon the user's texlive.tlpdb
++
++=head2 paper
++
++changes configuration files in user tree
++
++=head2 generate
++
++creates configuration files in user tree
++
++
++B<WARNING WARNING WARNING> Be again warned that this is very experimental!
++
+ =head1 MACHINE-READABLE OUTPUT
+
+ Given the C<--machine-readable> option, C<tlmgr> writes to stdout in the
+Index: tlpkg/TeXLive/TLConfig.pm
+===================================================================
+--- tlpkg/TeXLive/TLConfig.pm (revision 16521)
++++ tlpkg/TeXLive/TLConfig.pm (working copy)
+@@ -169,7 +169,8 @@
+
+ our %TLPDBSettings = (
+ "platform" => [ "s", "Main platform for this computer" ],
+- "available_architectures" => [ "l", "All available/installed architectures" ]
++ "available_architectures" => [ "l", "All available/installed architectures" ],
++ "usertree" => [ "b", "This tree acts as user tree" ]
+ );
+
+ our $WindowsMainMenuName = "TeX Live $ReleaseYear";
+Index: tlpkg/TeXLive/TLMedia.pm
+===================================================================
+--- tlpkg/TeXLive/TLMedia.pm (revision 16521)
++++ tlpkg/TeXLive/TLMedia.pm (working copy)
+@@ -60,6 +60,8 @@
+ }
+ if (-d "$location/texmf/web2c") {
+ $media = 'DVD';
++ } elsif (-d "$location/web2c") {
++ $media = 'DVD';
+ } elsif (-d "$location/$Archive") {
+ $media = 'CD';
+ } else {
+@@ -247,8 +249,12 @@
+ }
+ # if a package is relocatable we have to cancel the reloc prefix
+ # before we save it to the local tlpdb
+- if ($tlpobj->relocated) {
+- $tlpobj->cancel_reloc_prefix;
++ if ($reloc) {
++ if ($totlpdb->setting("usertree")) {
++ $tlpobj->cancel_reloc_prefix;
++ } else {
++ $tlpobj->replace_reloc_prefix;
++ }
+ }
+ # we have to write out the tlpobj file since it is contained in the
+ # archives (.tar.xz) but at DVD install time we don't have them
+@@ -317,7 +323,11 @@
+ } elsif ($what =~ m,\.tar(\.xz)?$,) {
+ my $type = defined($1) ? "xz" : "tar";
+
+- $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
++ if ($reloc) {
++ if (!$totlpdb->setting("usertree")) {
++ $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
++ }
++ }
+
+ # this is the case when we install from CD or the NET, or a backup
+ #
+@@ -400,6 +410,7 @@
+ my ($self, $pkg, $nopostinstall) = @_;
+ my $localtlpdb = $self->tlpdb;
+ my $tlp = $localtlpdb->get_package($pkg);
++ my $usertree = $localtlpdb->setting("usertree");
+ if (!defined($tlp)) {
+ tlwarn ("$pkg: package not present, cannot remove\n");
+ } else {
+@@ -426,9 +437,12 @@
+ # 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/:;
++ if (!$usertree) {
++ s:^$RelocPrefix/:$RelocTree/:;
++ }
+ }
+ }
+ #
+Index: tlpkg/TeXLive/TLPOBJ.pm
+===================================================================
+--- tlpkg/TeXLive/TLPOBJ.pm (revision 16521)
++++ tlpkg/TeXLive/TLPOBJ.pm (working copy)
+@@ -459,6 +459,21 @@
+ sub cancel_reloc_prefix {
+ my $self = shift;
+ my @docfiles = $self->docfiles;
++ for (@docfiles) { s:^$RelocPrefix/::; }
++ $self->docfiles(@docfiles);
++ my @runfiles = $self->runfiles;
++ for (@runfiles) { s:^$RelocPrefix/::; }
++ $self->runfiles(@runfiles);
++ my @srcfiles = $self->srcfiles;
++ for (@srcfiles) { s:^$RelocPrefix/::; }
++ $self->srcfiles(@srcfiles);
++ # if there are bin files they have definitely NOT the
++ # texmf-dist prefix, so we cannot cancel it anyway
++}
++
++sub replace_reloc_prefix {
++ my $self = shift;
++ my @docfiles = $self->docfiles;
+ for (@docfiles) { s:^$RelocPrefix/:$RelocTree/:; }
+ $self->docfiles(@docfiles);
+ my @runfiles = $self->runfiles;
+Index: tlpkg/TeXLive/TLUtils.pm
+===================================================================
+--- tlpkg/TeXLive/TLUtils.pm (revision 16521)
++++ tlpkg/TeXLive/TLUtils.pm (working copy)
+@@ -1245,7 +1245,7 @@
+ # if a package is relocatable we have to cancel the reloc prefix
+ # before we save it to the local tlpdb
+ if ($tlpobj->relocated) {
+- $tlpobj->cancel_reloc_prefix;
++ $tlpobj->replace_reloc_prefix;
+ }
+ $totlpdb->add_tlpobj($tlpobj);
+ # we have to write out the tlpobj file since it is contained in the