summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2013-04-13 05:32:44 +0000
committerNorbert Preining <preining@logic.at>2013-04-13 05:32:44 +0000
commit776874e7779ee459aecd4df8d2eddb68f492f17e (patch)
tree3365e588639069ebd6feab2ac8767ad53e4a1e33 /Master/tlpkg/TeXLive
parentbdcdba5ebfbf898456bac0a46f10458b602673b5 (diff)
user mode for tlmgr
support a user mode for tlmgr that allows installation of packages into user trees. git-svn-id: svn://tug.org/texlive/trunk@29883 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLConfig.pm3
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm27
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm15
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm2
4 files changed, 40 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm
index d6da6a76fa9..c8a8319bda2 100644
--- a/Master/tlpkg/TeXLive/TLConfig.pm
+++ b/Master/tlpkg/TeXLive/TLConfig.pm
@@ -185,7 +185,8 @@ our %TLPDBOptions = (
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";
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index a7c613ddf88..f0f1c25fc2c 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -283,6 +283,8 @@ sub from_file {
$media = 'local_uncompressed';
} elsif (-d "$rootpath/texmf/web2c") { # older
$media = 'local_uncompressed';
+ } elsif (-d "$rootpath/web2c") {
+ $media = 'local_uncompressed';
} elsif (-d "$rootpath/$Archive") {
$media = 'local_compressed';
} else {
@@ -1401,8 +1403,12 @@ sub install_package_files {
tlwarn("TLPDB::install_package_files: couldn't install $what!\n");
next;
}
- if ($tlpobj->relocated) {
- $tlpobj->cancel_reloc_prefix;
+ if ($reloc) {
+ if ($totlpdb->setting("usertree")) {
+ $tlpobj->cancel_reloc_prefix;
+ } else {
+ $tlpobj->replace_reloc_prefix;
+ }
$tlpobj->relocated(0);
}
my $tlpod = $self->root . "/tlpkg/tlpobj";
@@ -1652,7 +1658,11 @@ sub _install_package {
$root = $self->root;
}
# if we are installing a reloc, add the RelocTree to the target
- $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
+ if ($reloc) {
+ if (!$totlpdb->setting("usertree")) {
+ $target .= "/$TeXLive::TLConfig::RelocTree";
+ }
+ }
foreach my $file (@$what) {
# @what is taken, not @filelist!
@@ -1664,7 +1674,11 @@ sub _install_package {
# we always assume that copy will work
return(1);
} elsif ($what =~ m,\.tar(\.xz)?$,) {
- $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
+ if ($reloc) {
+ if (!$totlpdb->setting("usertree")) {
+ $target .= "/$TeXLive::TLConfig::RelocTree";
+ }
+ }
my $pkg = TeXLive::TLUtils::unpack($what, $target);
if (!$pkg) {
tlwarn("TLPDB::_install_package: couldn't unpack $what to $target\n");
@@ -1695,6 +1709,7 @@ sub remove_package {
my ($self, $pkg, %opts) = @_;
my $localtlpdb = $self;
my $tlp = $localtlpdb->get_package($pkg);
+ my $usertree = $localtlpdb->setting("usertree");
if (!defined($tlp)) {
tlwarn ("$pkg: package not present, cannot remove\n");
} else {
@@ -1723,7 +1738,9 @@ sub remove_package {
# since we don't have user mode
if ($tlp->relocated) {
for (@files) {
- s:^$RelocPrefix/:$RelocTree/:;
+ if (!$usertree) {
+ s:^$RelocPrefix/:$RelocTree/:;
+ }
}
}
#
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 3d8d695a82c..c49214ff194 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -401,6 +401,21 @@ sub writeout_simple {
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;
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 8dcc0d603a5..9ee6549e364 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1328,7 +1328,7 @@ sub install_packages {
# 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