summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPDB.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-04-17 08:50:52 +0000
committerNorbert Preining <preining@logic.at>2008-04-17 08:50:52 +0000
commit879ffd96ec3bdc67834400d7537e8e75754077e7 (patch)
treebab5b6e43761f0a7f2c49bd8e22ef525c10d6746 /Master/tlpkg/TeXLive/TLPDB.pm
parent31774a928820b9ede1b2624558c3dc725d8985fc (diff)
add an option to change the default location
tlmgr default location http://.... git-svn-id: svn://tug.org/texlive/trunk@7467 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm109
1 files changed, 99 insertions, 10 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index fc8d7b1ac58..857d4370b81 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -732,6 +732,28 @@ Need to be documented
=cut
+sub _set_option_value {
+ my ($self,$key,$value) = @_;
+ my $pkg = $self->{'tlps'}{'00texlive-installation.config'};
+ my @newdeps;
+ if (!defined($pkg)) {
+ my $pkg = new TeXLive::TLPOBJ;
+ $tlp->name("00texlive-installation.config");
+ $tlp->category("TLCore");
+ push @newdeps, "$key/$value";
+ } else {
+ foreach my $d ($pkg->depends) {
+ if ($d =~ m!^$key/!) {
+ push @newdeps, "$key/$value";
+ } else {
+ push @newdeps, $d;
+ }
+ }
+ }
+ $pkg->depends(@newdeps);
+ $self->{'tlps'}{'00texlive-installation.config'} = $pkg;
+}
+
sub _option_value {
my ($self,$key) = @_;
if (defined($self->{'tlps'}{'00texlive-installation.config'})) {
@@ -744,6 +766,33 @@ sub _option_value {
}
return;
}
+
+sub _set_option_setting {
+ my ($self,$key,$value) = @_;
+ my $pkg = $self->{'tlps'}{'00texlive-installation.config'};
+ my @newdeps;
+ if (!defined($pkg)) {
+ my $pkg = new TeXLive::TLPOBJ;
+ $tlp->name("00texlive-installation.config");
+ $tlp->category("TLCore");
+ if ($value) {
+ push @newdeps, "$key";
+ }
+ } else {
+ foreach my $d ($pkg->depends) {
+ if (($d =~ m!^$key$!) && (!$value)) {
+ # key is present, but we should clear it, so do nothing
+ } else {
+ # either the key is already present and we should set it (again) to on
+ # or it is something else
+ push @newdeps, $d;
+ }
+ }
+ }
+ $pkg->depends(@newdeps);
+ $self->{'tlps'}{'00texlive-installation.config'} = $pkg;
+}
+
sub _option_setting {
my ($self,$key) = @_;
if (defined($self->{'tlps'}{'00texlive-installation.config'})) {
@@ -757,16 +806,56 @@ sub _option_setting {
return;
}
-sub option_symlinks { my $self = shift; return $self->_option_setting("symlinks"); }
-sub option_docfiles { my $self = shift; return $self->_option_setting("docfiles"); }
-sub option_srcfiles { my $self = shift; return $self->_option_setting("srcfiles"); }
-sub option_formats { my $self = shift; return $self->_option_setting("formats"); }
-sub option_letter { my $self = shift; return $self->_option_setting("letter"); }
-sub option_location { my $self = shift; return $self->_option_value("location"); }
-sub option_sys_bin { my $self = shift; return $self->_option_value("sys_bin"); }
-sub option_sys_man { my $self = shift; return $self->_option_value("sys_man"); }
-sub option_sys_info { my $self = shift; return $self->_option_value("sys_info"); }
-sub option_platform { my $self = shift; return $self->_option_value("platform"); }
+sub option_symlinks {
+ my $self = shift;
+ if (@_) { $self->_set_option_setting("symlinks", shift); }
+ return $self->_option_setting("symlinks");
+}
+sub option_docfiles {
+ my $self = shift;
+ if (@_) { $self->_set_option_setting("docfiles", shift); }
+ return $self->_option_setting("docfiles");
+}
+sub option_srcfiles {
+ my $self = shift;
+ if (@_) { $self->_set_option_setting("srcfiles", shift); }
+ return $self->_option_setting("srcfiles");
+}
+sub option_formats {
+ my $self = shift;
+ if (@_) { $self->_set_option_setting("formats", shift); }
+ return $self->_option_setting("formats");
+}
+sub option_letter {
+ my $self = shift;
+ if (@_) { $self->_set_option_value("letter", shift); }
+ return $self->_option_setting("letter");
+}
+sub option_location {
+ my $self = shift;
+ if (@_) { $self->_set_option_value("location", shift); }
+ return $self->_option_value("location");
+}
+sub option_sys_bin {
+ my $self = shift;
+ if (@_) { $self->_set_option_value("sys_bin", shift); }
+ return $self->_option_value("sys_bin");
+}
+sub option_sys_man {
+ my $self = shift;
+ if (@_) { $self->_set_option_value("sys_man", shift); }
+ return $self->_option_value("sys_man");
+}
+sub option_sys_info {
+ my $self = shift;
+ if (@_) { $self->_set_option_value("sys_info", shift); }
+ return $self->_option_value("sys_info");
+}
+sub option_platform {
+ my $self = shift;
+ if (@_) { $self->_set_option_value("platform", shift); }
+ return $self->_option_value("platform");
+}
=pod