diff options
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 109 |
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 |