diff options
-rwxr-xr-x | Master/install-tl | 41 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 92 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPSRC.pm | 2 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 2 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc | 12 |
5 files changed, 48 insertions, 101 deletions
diff --git a/Master/install-tl b/Master/install-tl index 4b6557a854d..be9942ca293 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -770,36 +770,17 @@ sub do_install_packages { # into the local tlpdb: # - should links be set, and if yes, the destination (bin,man,info) sub save_options_into_tlpdb { - my $tlp = new TeXLive::TLPOBJ; - $tlp->name("00texlive-installation.config"); - $tlp->category("TLCore"); - my @deps; - push @deps, "platform/$::_platform_"; - if ($::_media_ eq 'NET') { - push @deps, "location/$TeXLiveURL"; - } else { - push @deps, "location/" . abs_path($::installerdir); - } - if ($vars{'option_letter'}) { - push @deps, "letter"; - } - if ($vars{'option_fmt'}) { - push @deps, "formats"; - } - if ($vars{'option_symlinks'}) { - push @deps, "symlinks"; - push @deps, "sys_bin/$vars{'sys_bin'}"; - push @deps, "sys_info/$vars{'sys_info'}"; - push @deps, "sys_man/$vars{'sys_man'}"; - } - if ($vars{'option_doc'}) { - push @deps, "docfiles"; - } - if ($vars{'option_src'}) { - push @deps, "srcfiles"; - } - $tlp->depends(@deps); - $localtlpdb->add_tlpobj($tlp); + $localtlpdb->option_platform($::_platform_); + $localtlpdb->option_location( + (($::_media_ eq 'NET') ? "$TeXLiveURL" : abs_path($::installerdir))); + $localtlpdb->option_paper($vars{'option_letter'} ? "letter" : "a4"); + $localtlpdb->option_formats($vars{'option_fmt'} ? "1" : "0"); + $localtlpdb->option_symlinks($vars{'option_symlinks'} ? "1" : "0"); + $localtlpdb->option_sys_bin($vars{'sys_bin'}); + $localtlpdb->option_sys_info($vars{'sys_info'}); + $localtlpdb->option_sys_man($vars{'sys_man'}); + $localtlpdb->option_docfiles($vars{'option_doc'} ? "1" : "0"); + $localtlpdb->option_srcfiles($vars{'option_doc'} ? "1" : "0"); $localtlpdb->save(); } diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 4af36adf753..0c073e86cf7 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -771,22 +771,22 @@ sub _set_option_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"; + $pkg = new TeXLive::TLPOBJ; + $pkg->name("00texlive-installation.config"); + $pkg->category("TLCore"); + push @newdeps, "$key:$value"; } else { my $found = 0; foreach my $d ($pkg->depends) { - if ($d =~ m!^$key/!) { + if ($d =~ m!^$key:!) { $found = 1; - push @newdeps, "$key/$value"; + push @newdeps, "$key:$value"; } else { push @newdeps, $d; } } if (!$found) { - push @newdeps, "$key/$value"; + push @newdeps, "$key:$value"; } } $pkg->depends(@newdeps); @@ -797,7 +797,7 @@ sub _option_value { my ($self,$key) = @_; if (defined($self->{'tlps'}{'00texlive-installation.config'})) { foreach my $d ($self->{'tlps'}{'00texlive-installation.config'}->depends) { - if ($d =~ m!^$key/(.*)$!) { + if ($d =~ m!^$key:(.*)$!) { return "$1"; } } @@ -806,84 +806,38 @@ 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 { - my $found = 0; - foreach my $d ($pkg->depends) { - if ($d =~ m!^$key$!) { - # we have already the setting to true because it is present - $found = 1; - if ($value) { - # we have to keep it true, so push it to the newdeps - push @newdeps, $d; - } else { - # nothing to be done because the setting should be cleared - } - } else { - # this is a different setting, so keep it - push @newdeps, $d; - } - } - if (!$found && $value) { - # the setting is not present but we want to have it - push @newdeps, "$key"; - } - } - $pkg->depends(@newdeps); - $self->{'tlps'}{'00texlive-installation.config'} = $pkg; -} - -sub _option_setting { - my ($self,$key) = @_; - if (defined($self->{'tlps'}{'00texlive-installation.config'})) { - foreach my $d ($self->{'tlps'}{'00texlive-installation.config'}->depends) { - if ($d =~ m!^$key$!) { - return 1; - } - } - return 0; - } - return 0; -} - sub option_symlinks { my $self = shift; - if (@_) { $self->_set_option_setting("symlinks", shift); } - return $self->_option_setting("symlinks"); + if (@_) { $self->_set_option_value("symlinks", shift); } + return $self->_option_value("symlinks"); } sub option_docfiles { my $self = shift; - if (@_) { $self->_set_option_setting("docfiles", shift); } - return $self->_option_setting("docfiles"); + if (@_) { $self->_set_option_value("docfiles", shift); } + return $self->_option_value("docfiles"); } sub option_srcfiles { my $self = shift; - if (@_) { $self->_set_option_setting("srcfiles", shift); } - return $self->_option_setting("srcfiles"); + if (@_) { $self->_set_option_value("srcfiles", shift); } + return $self->_option_value("srcfiles"); } sub option_formats { my $self = shift; - if (@_) { $self->_set_option_setting("formats", shift); } - return $self->_option_setting("formats"); + if (@_) { $self->_set_option_value("formats", shift); } + return $self->_option_value("formats"); } -sub option_letter { +sub option_paper { my $self = shift; - if (@_) { $self->_set_option_value("letter", shift); } - return $self->_option_setting("letter"); + if (@_) { $self->_set_option_value("paper", shift); } + return $self->_option_value("paper"); } sub option_location { my $self = shift; if (@_) { $self->_set_option_value("location", shift); } + my $loc = $self->_option_value("location"); + if ($loc eq "__MASTER__") { + return $self->root; + } return $self->_option_value("location"); } sub option_sys_bin { diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm index c1cf75656a1..b0272bb68ea 100644 --- a/Master/tlpkg/TeXLive/TLPSRC.pm +++ b/Master/tlpkg/TeXLive/TLPSRC.pm @@ -82,7 +82,7 @@ sub from_file if ($line =~ /^ /) { die "$srcfile: continuation line not allowed in tlpsrc: $line\n"; } - if ($line =~ /^name\s*([-\w]+(\.win32)?|00texlive\..*|0texlive\..*)$/) { + if ($line =~ /^name\s*([-\w]+(\.win32)?|00texlive.*|0texlive.*)$/) { $name = "$1"; $started && die("$srcfile: tlpsrc cannot have two name directives"); $started = 1; diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 3c1089f8052..0e4ff4713a0 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -698,7 +698,7 @@ gives the extension for the C<lzmadec> binary. sub setup_programs { my ($bindir, $platform) = @_; $::progs{'wget'} = "wget"; - if (!defined($platform)) { + if (!defined($platform) || ($platform eq "")) { # we assume that we run from the DVD, so we can call platform() and # thus also the config.guess script # but we have to setup $::installerdir because that stupid diff --git a/Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc b/Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc new file mode 100644 index 00000000000..ceedb22e802 --- /dev/null +++ b/Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc @@ -0,0 +1,12 @@ +name 00texlive-installation.config +category TLCore +depend platform: +depend location:__MASTER__ +depend paper:a4 +depend formats:0 +depend symlinks:0 +depend sys_bin:/usr/local/bin +depend sys_info:/usr/local/info +depend sys_man:/usr/local/man +depend docfiles:0 +depend srcfiles:0 |