summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-07-03 15:27:37 +0000
committerNorbert Preining <preining@logic.at>2009-07-03 15:27:37 +0000
commit9167358afb2bd622448cf97615899cba00556bc5 (patch)
tree941e6c12cbc2bcfbc51f5097b67ac9e8d9ba7faf /Master
parente14a9d60c5f2c2734d18d1d5e4f8464633ab9a60 (diff)
the "Tokyo-Vienna-cramped-flight-commit":
- unify installer keys of the %vars hash to always use option_ prefix if it is an option - unify the layout of things in 00texlive.installation so that user settable things look like opt_$key:vallue, and internal things setting_$key:vale - add list of supported options to TLConfig, with type definitions - use a unified option call $tlpdb->option($key [, $value, $value]) instead of many different $tlpdb->option_foo_bar - adapt install-tl, uninstall-w32, tlmgr, tlpkg/bin, TeXLive::*, installer plugins, to use this new function instead - make the setting_platform:XXXXX (formerly platform:XXXXX) in 00texlive.installation only optional. It is not saved into the TLPDB if the *default* platform as returned by TeXLive::TLUtils::platform() (thus calling config.guess on unix). Only if you override the platform in the installer with -force-arch then this value is set in the TLPDB - implement TLMedia->platform that checks first the included TLPDB for option("platform"), and if that is not given determines the platform using TLUtils::platform(). - move the add_symlinks and remove_symlinks from TLPDB to TLMedia - sanatize the installer modules: perltk is now equivalent to text - tlmgr: . output of tlmgr option [show] does now show all the set options, but ignores irrelevant ones for the respective platform (sys_bin/man/info for win32, desktop_integration etc for unix) . option handling rewritten in a general way so that we only have to add new options to TLConfig::%TLPDBOptionXXXXX . setting an option is verified against the types of the options . implement tlmgr option showall that shows also options that are currently not set/saved in the TLPDB - TLUtils: honor the w32_multi_user setting also for shortcuts and menu items - tlmgrgui: . implement support for most options that are set in the TLPDB . add buttons to remove/add symlinks git-svn-id: svn://tug.org/texlive/trunk@14083 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/install-tl102
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl366
-rw-r--r--Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl164
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl15
-rw-r--r--Master/texmf/scripts/texlive/uninstall-win32.pl13
-rw-r--r--Master/tlpkg/TeXLive/TLConfig.pm73
-rw-r--r--Master/tlpkg/TeXLive/TLMedia.pm168
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm350
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlnet2
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb3
-rwxr-xr-xMaster/tlpkg/bin/tlpsrc2tlpdb3
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl12
-rwxr-xr-xMaster/tlpkg/installer/install-menu-text.pl40
-rw-r--r--Master/tlpkg/installer/install-menu-wizard.pl16
-rw-r--r--Master/tlpkg/installer/install-translations.pl1
-rw-r--r--Master/tlpkg/installer/installer-options.txt72
-rw-r--r--Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc16
17 files changed, 796 insertions, 620 deletions
diff --git a/Master/install-tl b/Master/install-tl
index de7daf156d4..7f70d6f9a7f 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -123,10 +123,10 @@ our @collections_lang_doc;
# $tlpdb->option_XXXXX
# settings (i.e., taken from tlpkg/tlpsrc/00texlive.installation.tlpsrc
#
-# 'option_symlinks' => 0,
-# 'sys_bin' => '/usr/local/bin',
-# 'sys_man' => '/usr/local/man',
-# 'sys_info' => '/usr/local/info',
+# 'option_path' => 0,
+# 'option_sys_bin' => '/usr/local/bin',
+# 'option_sys_man' => '/usr/local/man',
+# 'option_sys_info' => '/usr/local/info',
# 'option_doc' => 1,
# 'option_src' => 1,
# 'option_fmt' => 0,
@@ -364,7 +364,7 @@ if ($location =~ m!^(ctan$|(http|ftp)://)!i) {
$media = 'NET';
}
}
-info("Installing from: $location\n");
+info("Installing TeX Live $TeXLive::TLConfig::ReleaseYear from: $location\n");
if (defined($opt_force_arch)) {
tlwarn("Overriding platform to $opt_force_arch\n");
@@ -1122,22 +1122,22 @@ sub load_tlpdb {
die "$0: Could not load TeX Live Database from $master, goodbye.\n";
}
# set the defaults to what is specified in the tlpdb
- $vars{'option_doc'} = $tlpdb->option_install_docfiles;
- $vars{'option_src'} = $tlpdb->option_install_srcfiles;
- $vars{'option_fmt'} = $tlpdb->option_create_formats;
- $vars{'option_letter'} = defined($tlpdb->option_paper)
- && ($tlpdb->option_paper eq "letter" ? 1 : 0);
- $vars{'option_desktop_integration'} = $tlpdb->option_desktop_integration;
+ $vars{'option_doc'} = $tlpdb->option("install_docfiles");
+ $vars{'option_src'} = $tlpdb->option("install_srcfiles");
+ $vars{'option_fmt'} = $tlpdb->option("create_formats");
+ $vars{'option_letter'} = defined($tlpdb->option("paper"))
+ && ($tlpdb->option("paper") eq "letter" ? 1 : 0);
+ $vars{'option_desktop_integration'} = $tlpdb->option("desktop_integration");
$vars{'option_desktop_integration'} = 1 if win32();
- $vars{'option_path'} = $tlpdb->option_path;
+ $vars{'option_path'} = $tlpdb->option("path");
$vars{'option_path'} = 1 if win32();
- $vars{'option_w32_multi_user'} = $tlpdb->option_w32_multi_user;
- $vars{'option_file_assocs'} = $tlpdb->option_file_assocs;
+ $vars{'option_w32_multi_user'} = $tlpdb->option("w32_multi_user");
+ $vars{'option_file_assocs'} = $tlpdb->option("file_assocs");
# $vars{'option_file_assocs'} = 1 if win32();
- $vars{'option_post_code'} = $tlpdb->option_post_code;
- $vars{'sys_bin'} = $tlpdb->option_sys_bin;
- $vars{'sys_man'} = $tlpdb->option_sys_man;
- $vars{'sys_info'} = $tlpdb->option_sys_info;
+ $vars{'option_post_code'} = $tlpdb->option("post_code");
+ $vars{'option_sys_bin'} = $tlpdb->option("sys_bin");
+ $vars{'option_sys_man'} = $tlpdb->option("sys_man");
+ $vars{'option_sys_info'} = $tlpdb->option("sys_info");
# check that the default scheme is actually present, otherwise switch to
# scheme-minimal
@@ -1245,11 +1245,6 @@ sub create_profile {
if $key=~/^collection/ and $vars{$key}==1;
print $fh "$key $vars{$key}\n" if $key =~ /^option_/;
print $fh "$key $vars{$key}\n" if (($key =~ /^binary_/) && $vars{$key});
- if ($vars{'option_desktop_integration'} && unix()) {
- print $fh "sys_bin ", $vars{'sys_bin'}, "\n" if $key =~ /^sys_bin/;
- print $fh "sys_man ", $vars{'sys_man'}, "\n" if $key =~ /^sys_man/;
- print $fh "sys_info ", $vars{'sys_info'}, "\n" if $key =~ /^sys_info/;
- }
print $fh "$key $vars{$key}\n" if $key=~/^TEXDIR/; # includes TEXDIRW
print $fh "$key $vars{$key}\n" if $key=~/^TEXMFSYSVAR/;
print $fh "$key $vars{$key}\n" if $key=~/^TEXMFSYSCONFIG/;
@@ -1339,20 +1334,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 {
- $localtlpdb->option_platform($::_platform_);
- $localtlpdb->option_location($location);
- $localtlpdb->option_paper($vars{'option_letter'} ? "letter" : "a4");
- $localtlpdb->option_create_formats($vars{'option_fmt'} ? "1" : "0");
- $localtlpdb->option_desktop_integration($vars{'option_desktop_integration'} ? "1" : "0");
- $localtlpdb->option_file_assocs($vars{'option_file_assocs'} ? "1" : "0");
- $localtlpdb->option_path($vars{'option_path'} ? "1" : "0");
- $localtlpdb->option_post_code($vars{'option_post_code'} ? "1" : "0");
- $localtlpdb->option_w32_multi_user($vars{'option_w32_multi_user'} ? "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_install_docfiles($vars{'option_doc'} ? "1" : "0");
- $localtlpdb->option_install_srcfiles($vars{'option_src'} ? "1" : "0");
+ $localtlpdb->option ("location", $location);
+ $localtlpdb->option ("create_formats", $vars{'option_fmt'} ? "1" : "0");
+ $localtlpdb->option ("desktop_integration", $vars{'option_desktop_integration'} ? "1" : "0");
+ $localtlpdb->option ("file_assocs", $vars{'option_file_assocs'} ? "1" : "0");
+ $localtlpdb->option ("post_code", $vars{'option_post_code'} ? "1" : "0");
+ $localtlpdb->option ("sys_bin", $vars{'option_sys_bin'});
+ $localtlpdb->option ("sys_info", $vars{'option_sys_info'});
+ $localtlpdb->option ("sys_man", $vars{'option_sys_man'});
+ $localtlpdb->option ("install_docfiles", $vars{'option_doc'} ? "1" : "0");
+ $localtlpdb->option ("install_srcfiles", $vars{'option_src'} ? "1" : "0");
+ $localtlpdb->option ("w32_multi_user", $vars{'option_w32_multi_user'} ? "1" : "0");
my @archs;
foreach (keys %vars) {
if (m/^binary_(.*)$/ ) {
@@ -1362,7 +1354,12 @@ sub save_options_into_tlpdb {
if ($opt_custom_bin) {
push @archs, "custom";
}
- $localtlpdb->option_available_architectures(@archs);
+
+ # only if we forced the platform we do save this option into the tlpdb
+ if (defined($opt_force_arch)) {
+ $localtlpdb->setting ("platform", $::_platform_);
+ }
+ $localtlpdb->setting("available_architectures", @archs);
$localtlpdb->save() unless $vars{'from_dvd'};
}
@@ -1407,38 +1404,33 @@ sub import_settings_from_old_tlpdb {
# set the defaults to what is specified in the tlpdb
$vars{'option_doc'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_install_docfiles");
+ "install_docfiles");
$vars{'option_src'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_install_srcfiles");
+ "install_srcfiles");
$vars{'option_fmt'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_create_formats");
- my $tmp = $previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_paper");
- $vars{'option_letter'} = defined($tmp) && ($tmp eq "letter" ? 1 : 0);
+ "create_formats");
$vars{'option_desktop_integration'} = 1 if win32();
# option_path does not exist in older installation
$vars{'option_path'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_create_symlinks");
+ "create_symlinks");
$vars{'option_path'} = 1 if win32();
- $vars{'sys_bin'} =
+ $vars{'option_sys_bin'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_sys_bin");
- $vars{'sys_man'} =
+ "sys_bin");
+ $vars{'option_sys_man'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_sys_man");
+ "sys_man");
$vars{'sys_info'} =
$previoustlpdb->option_pkg("00texlive-installation.config",
- "opt_sys_info");
+ "sys_info");
#
# import the set of selected architectures
- my $val = $previoustlpdb->option_pkg("00texlive-installation.config",
- "available_architectures");
- my @aar;
- if (defined($val)) {
- @aar = split(" ", $val);
+ my @aar = $previoustlpdb->setting_pkg("00texlive-installation.config",
+ "available_architectures");
+ if (@aar) {
for my $b ($tlpdb->available_architectures) {
$vars{"binary_$b"} = member( $b, @aar );
}
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 23368a4f323..397c95ae950 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -9,10 +9,6 @@
# - in GUI mode updating texlive.infra DOES work without
# the warning, but it does NOT force to restart the GUI. THAT IS BAD!!!
#
-# - when tlmgr2.pl is shipped globally as tlmgr.pl we can switch the
-# installer from using either texconfig paper or texlua ... to
-# tlmgr paper letter which will work on all platforms transparently.
-#
# - tlmgr should have a "progress" bar for the update --all and install
# etc options, echoing number of total packages etc etc.
#
@@ -52,6 +48,7 @@ BEGIN {
# if not in bootstrapping mode => kpsewhich exists, so use it to get $Master
chomp($Master = `kpsewhich -var-value=SELFAUTOPARENT`);
}
+ $::installerdir = $Master;
#
# make Perl find our packages first:
@@ -209,7 +206,6 @@ if (defined($action) && ($action =~ m/^help/i)) {
}
if (defined($action) && ($action =~ m/^print-arch$/i)) {
- $::installerdir = $Master;
print TeXLive::TLUtils::platform(), "\n";
exit 0;
}
@@ -483,7 +479,7 @@ sub handle_execute_actions {
# format-regenerate is used when the paper size changes. In that
- # case, if option_create_formats is set, we simply want to generate
+ # case, if option("create_formats") is set, we simply want to generate
#
{
my %done_formats;
@@ -506,7 +502,7 @@ sub handle_execute_actions {
for my $m (keys %{$::execute_actions{'disable'}{'formats'}}) {
$do_full = 1;
}
- my $opt_fmt = $localtlpdb->option_create_formats;
+ my $opt_fmt = $localtlpdb->option("create_formats");
if ($do_full) {
info("regenerating fmtutil.cnf in $TEXMFSYSVAR\n");
TeXLive::TLUtils::create_fmtutil($localtlpdb,
@@ -572,7 +568,7 @@ sub handle_execute_actions {
# Use full path for external command, except on Windows.
$lang = "$TEXMFSYSVAR/tex/generic/config/$lang";
}
- if ($localtlpdb->option_create_formats && !$::regenerate_all_formats) {
+ if ($localtlpdb->option("create_formats") && !$::regenerate_all_formats) {
$errors += do_cmd_and_check("fmtutil-sys --byhyphen $lang");
}
}
@@ -890,10 +886,10 @@ sub action_symlinks {
}
init_local_db();
if ($what =~ m/^add$/i) {
- $localtlpdb->add_symlinks();
+ $localtlmedia->add_symlinks();
} elsif ($what =~ m/^remove$/i) {
# remove symlinks
- $localtlpdb->remove_symlinks();
+ $localtlmedia->remove_symlinks();
} else {
# that should not happen
tlwarn("that should not happen, action_symlinks what=$what\n");
@@ -1157,8 +1153,8 @@ sub write_w32_updater {
my $container_doc_split = $mediatlpdb->config_doc_container;
# get options about src/doc splitting from $totlpdb
# TT: should we use local options to decide about install of doc & src?
- my $opt_src = $localtlpdb->option_install_srcfiles;
- my $opt_doc = $localtlpdb->option_install_docfiles;
+ my $opt_src = $localtlpdb->option("install_srcfiles");
+ my $opt_doc = $localtlpdb->option("install_docfiles");
my $root = $localtlpdb->root;
my $temp = "$root/temp";
my $repo = $mediatlpdb->root . "/$Archive";
@@ -1178,7 +1174,8 @@ sub write_w32_updater {
$localtlp = $localtlpdb->get_package($pkg);
$oldrev = $localtlp->revision;
$newrev = $mediatlp->revision;
- # we do install documenation files for category Documentation even if option_install_docfiles is false
+ # we do install documenation files for category Documentation even if
+ # option("install_docfiles") is false
$opt_real_doc = ($mediatlp->category =~ m/documentation/i) ? 1 : $opt_doc;
@pkg_parts = ($pkg);
push(@pkg_parts, "$pkg.source") if ($container_src_split && $opt_src && $mediatlp->srcfiles);
@@ -1552,8 +1549,8 @@ sub action_update {
# for size calculation we also want w32 special packages
if (@new || @updated || @w32_updated) {
%sizes = %{$tlmediatlpdb->sizes_of_packages(
- $localtlpdb->option_install_srcfiles,
- $localtlpdb->option_install_docfiles,
+ $localtlpdb->option("install_srcfiles"),
+ $localtlpdb->option("install_docfiles"),
@new, @updated, @w32_updated)};
} else {
$sizes{'__TOTAL__'} = 0;
@@ -1951,175 +1948,131 @@ sub action_option {
$what = "show" unless defined($what);
init_local_db();
if ($what =~ m/^show$/i) {
- print "Default installation location (location): ",
- $localtlpdb->option_location, "\n";
- print "Create formats on installation (formats): ",
- ($localtlpdb->option_create_formats ? "yes" : "no"), "\n";
- print "Install documentation files (docfiles): ",
- ($localtlpdb->option_install_docfiles ? "yes": "no"), "\n";
- print "Install source files (srcfiles): ",
- ($localtlpdb->option_install_srcfiles ? "yes": "no"), "\n";
- print "Destination for symlinks for binaries (sys_bin): ",
- $localtlpdb->option_sys_bin, "\n"
- if $localtlpdb->option_sys_bin;
- print "Destination for symlinks for man pages (sys_man): ",
- $localtlpdb->option_sys_man, "\n"
- if $localtlpdb->option_sys_man;
- print "Destination for symlinks for info docs (sys_info): ",
- $localtlpdb->option_sys_info, "\n"
- if $localtlpdb->option_sys_info;
- print "Directory for backups (backupdir): ",
- $localtlpdb->option("backupdir"), "\n"
- if $localtlpdb->option("backupdir");
- print "Number of backups to keep (autobackup): ",
- $localtlpdb->option("autobackup"), "\n"
- if $localtlpdb->option("autobackup");
- } elsif ($what =~ m/^location$/i) {
- # changes the default location
- my $loc = shift @ARGV;
- if ($loc) {
- # support "ctan" on the cmd line, and don't abs_path it!
- if ($loc =~ m/^ctan$/i) {
- $loc = "$TeXLive::TLConfig::TeXLiveURL";
- }
- if ($loc !~ m!^(http|ftp)://!i) {
- # seems to be a local path, try to normalize it
- my $testloc = abs_path($loc);
- # however, if we were given a url, that will get "normalized" to the
- # empty string, it not being a path. Restore the original value if so.
- $loc = $testloc if $testloc;
- }
- info("tlmgr: setting default installation location to $loc\n");
- $localtlpdb->option_location($loc);
- $localtlpdb->save;
- } else {
- info("Default installation location: ",
- $localtlpdb->option_location, "\n");
- }
- } elsif ($what =~ m/^docfiles$/i) {
- # changes the default docfiles
- my $loc = shift @ARGV;
- if (defined($loc)) {
- info("tlmgr: defaulting to", ($loc ? "" : " not"),
- " installing documentation files.\n");
- $localtlpdb->option_install_docfiles($loc);
- $localtlpdb->save;
- } else {
- info("Install documentation files: ",
- $localtlpdb->option_install_docfiles, "\n");
- }
- } elsif ($what =~ m/^srcfiles$/i) {
- # changes the default srcfiles
- my $loc = shift @ARGV;
- if (defined($loc)) {
- info("tlmgr: defaulting to", ($loc ? "" : " not"),
- " installing source files.\n");
- $localtlpdb->option_install_srcfiles($loc);
- $localtlpdb->save;
- } else {
- info("Install source files: ",
- $localtlpdb->option_install_srcfiles, "\n");
- }
- } elsif ($what =~ m/^formats$/i) {
- # changes the default formats
- my $loc = shift @ARGV;
- if (defined($loc)) {
- info("tlmgr: defaulting to", ($loc ? "" : " not"),
- " generating format files on installation.\n");
- $localtlpdb->option_create_formats($loc);
- $localtlpdb->save;
- } else {
- info("Create formats on installation: ",
- $localtlpdb->option_create_formats, "\n");
- }
- } elsif ($what =~ m/^sys_man$/i) {
- # changes the default sys_man
- my $loc = shift @ARGV;
- if (defined($loc)) {
- info("tlmgr: setting destination for symlinks to man pages to $loc\n");
- $localtlpdb->option_sys_man ($loc);
- $localtlpdb->save;
- } else {
- info("Destination for symlinks to man pages: ",
- $localtlpdb->option_sys_man, "\n");
- }
- } elsif ($what =~ m/^sys_info$/i) {
- # changes the default sys_info
- my $loc = shift @ARGV;
- if (defined($loc)) {
- info("tlmgr: setting destination for symlinks to info pages to $loc\n");
- $localtlpdb->option_sys_info ($loc);
- $localtlpdb->save;
- } else {
- info("Default destination for symlinks to info pages: ",
- $localtlpdb->option_sys_info, "\n");
- }
- } elsif ($what =~ m/^sys_bin$/i) {
- # changes the default sys_bin
- my $loc = shift @ARGV;
- if (defined($loc)) {
- info("tlmgr: setting destination for symlinks to binaries to $loc\n");
- $localtlpdb->option_sys_bin ($loc);
- $localtlpdb->save;
- } else {
- info("Default destination for symlinks to binaries: ",
- $localtlpdb->option_sys_bin, "\n");
- }
- } elsif ($what =~ m/^backupdir$/i) {
- my $val = shift @ARGV;
- if (defined($val)) {
- info("tlmgr: setting option $what to $val.\n");
- if (! -d $val) {
- info("tlmgr: the directory $val does not exists, it has to be created\n");
- info("tlmgr: before backups can be done automatically.\n");
- }
- $localtlpdb->option($what,$val);
- $localtlpdb->save;
- } else {
- info("Option $what = ", $localtlpdb->option($what), "\n");
- }
- } elsif ($what =~ m/^autobackup$/i) {
- my $val = shift @ARGV;
- if (defined($val)) {
- if ($val =~ m/-?[0-9]+/) {
- if ($val < -1) {
- tlwarn "Value $val for autobackup not supported, must be >= -1\n";
- return;
- }
- } elsif ($val =~ m/^infty$/i) {
- $val = -1;
+ for my $o (keys %{$localtlpdb->options}) {
+ # ignore some things which are win32 specific
+ next if ($o eq "desktop_integration" && !win32());
+ next if ($o eq "file_assocs" && !win32());
+ next if ($o eq "w32_multi_user" && !win32());
+ if (win32()) {
+ next if ($o =~ m/^sys_/);
+ }
+ if (defined $TLPDBOptionDesc{$o}) {
+ info("$TLPDBOptionDesc{$o} ($TLPDBOptionTlmgrName{$o}): " .
+ $localtlpdb->option($o) . "\n");
} else {
- tlwarn "Value $val for autobackup not supported, must be >= -1\n";
- return;
+ tlwarn ("option $o not supported\n");
}
- info("tlmgr: setting option $what to $val");
- $localtlpdb->option($what,$val);
- $localtlpdb->save;
- } else {
- $val = $localtlpdb->option($what);
- info("Option $what = $val");
}
- if ($val == -1) {
- info(" (make and keep infinitely many backups)\n");
- } elsif ($val == 0) {
- info(" (don't keep any backups)\n");
- } else {
- info(" (make and keep $val backups)\n");
- }
- } elsif (member($what, @AllowedConfigOptions)) {
- # for all further options not handled above, we check whether they
- # appear in the list of allowed options; if they do, we set/read
- # the values, otherwise we warn.
- my $val = shift @ARGV;
- if (defined($val)) {
- info("tlmgr: setting option $what to $val.\n");
- $localtlpdb->option($what,$val);
- $localtlpdb->save;
- } else {
- info("Option $what = ", $localtlpdb->option($what), "\n");
+ } elsif ($what =~ m/^showall$/i) {
+ my %loc = %{$localtlpdb->options};
+ for my $o (keys %TLPDBOptionDesc) {
+ info("$TLPDBOptionDesc{$o} ($TLPDBOptionTlmgrName{$o}): " .
+ (defined($loc{$o}) ? $loc{$o} : "(not set)") . "\n");
}
} else {
- tlwarn "Option $what is currently not supported.\n";
+ my $found = 0;
+ for my $opt (keys %TLPDBOptionTlmgrName) {
+ if ($what eq $TLPDBOptionTlmgrName{$opt}) {
+ $found = 1;
+ # the option argument matches the name
+ my $val = shift @ARGV;
+ if (defined($val)) {
+ # set new value
+ # here we have to care for some special cases
+ if ($what eq $TLPDBOptionTlmgrName{"location"}) {
+ # support "ctan" on the cmd line, and don't abs_path it!
+ if ($val =~ m/^ctan$/i) {
+ $val = "$TeXLive::TLConfig::TeXLiveURL";
+ }
+ if ($val !~ m!^(http|ftp)://!i) {
+ # seems to be a local path, try to normalize it
+ my $testloc = abs_path($val);
+ # however, if we were given a url, that will get "normalized"
+ # to the empty string, it not being a path.
+ # Restore the original value if so.
+ $val = $testloc if $testloc;
+ }
+ info("tlmgr: setting default installation location to $val\n");
+ $localtlpdb->option($opt, $val);
+ } elsif ($what eq $TLPDBOptionTlmgrName{"backupdir"}) {
+ info("tlmgr: setting option $what to $val.\n");
+ if (! -d $val) {
+ info("tlmgr: the directory $val does not exists, it has to be created\n");
+ info("tlmgr: before backups can be done automatically.\n");
+ }
+ $localtlpdb->option($opt, $val);
+ } elsif ($what eq $TLPDBOptionTlmgrName{"w32_multi_user"}) {
+ # when running w32 do not allow that a non-admin users sets
+ # this from false to true
+ if (win32() && !admin() && !$val) {
+ tlwarn("tlmgr: non-admin user cannot set $TLPDBOptionTlmgrName{'w32_multi_user'} option to true\n");
+ } else {
+ if ($val) {
+ info("tlmgr: setting option $what to 1.\n");
+ $localtlpdb->option($opt, 1);
+ } else {
+ info("tlmgr: setting option $what to 0.\n");
+ $localtlpdb->option($opt, 0);
+ }
+ }
+ } else {
+ # default case, switch for different types
+ if ($TLPDBOptionType{$opt} eq "b") {
+ if ($val) {
+ info("tlmgr: setting option $what to 1.\n");
+ $localtlpdb->option($opt, 1);
+ } else {
+ info("tlmgr: setting option $what to 0.\n");
+ $localtlpdb->option($opt, 0);
+ }
+ } elsif ($TLPDBOptionType{$opt} eq "p") {
+ info("tlmgr: setting option $what to $val.\n");
+ $localtlpdb->option($opt, $val);
+ } elsif ($TLPDBOptionType{$opt} eq "u") {
+ info("tlmgr: setting option $what to $val.\n");
+ $localtlpdb->option($opt, $val);
+ } elsif ($TLPDBOptionType{$opt} =~ m/^n(:((-)?\d+)?..((-)?\d+)?)?$/) {
+ my $isgood = 1;
+ my $n = int($val);
+ my $low;
+ my $up;
+ if (defined($1)) {
+ # range given
+ if (defined($2)) {
+ # lower border
+ if ($2 > $n) {
+ tlwarn("value $n for $what out of range ($TLPDBOptionType{$opt})\n");
+ $isgood = 0;
+ }
+ }
+ if (defined($4)) {
+ # upper border
+ if ($4 < $n) {
+ tlwarn("value $n for $what out of range ($TLPDBOptionType{$opt})\n");
+ $isgood = 0;
+ }
+ }
+ }
+ if ($isgood) {
+ info("tlmgr: setting option $what to $n.\n");
+ $localtlpdb->option($opt, $n);
+ }
+ } else {
+ tlwarn ("Unknown type of option $opt: $TLPDBOptionType{$opt}\n");
+ }
+ }
+ $localtlpdb->save;
+ } else {
+ # show current value
+ info ("$TLPDBOptionDesc{$opt} ($TLPDBOptionTlmgrName{$opt}): " .
+ $localtlpdb->option($opt) . "\n");
+ }
+ last;
+ }
+ }
+ if (!$found) {
+ tlwarn("tlmgr: option $what not supported!\n");
+ }
}
return;
}
@@ -2198,10 +2151,10 @@ sub action_arch {
info("install: tlpsv.win32\n");
$tlmediasrc->install_package("tlpsv.win32", $localtlpdb);
}
- # update the option_archs list of installed archs
- my @larchs = $localtlpdb->option_available_architectures;
+ # update the option("available_architectures") list of installed archs
+ my @larchs = $localtlpdb->setting("available_architectures");
push @larchs, @todoarchs;
- $localtlpdb->option_available_architectures(@larchs);
+ $localtlpdb->setting("available_architectures",@larchs);
$localtlpdb->save;
} else {
die "Unknown option for arch: $what";
@@ -2351,7 +2304,7 @@ sub action_uninstall {
}
print ("Ok, removing the whole installation:\n");
init_local_db();
- $localtlpdb->remove_symlinks;
+ $localtlmedia->remove_symlinks;
# now do remove the rest
system("rm", "-rf", "$Master/texmf-dist");
system("rm", "-rf", "$Master/texmf-doc");
@@ -2409,9 +2362,10 @@ sub action_recreate_tlpdb {
# we have to find out the default arch
# if there is only one dir in $Master/bin then we are settled,
# otherwise we expect the user to pass a correct arch string
- if ($^O =~ /^MSWin(32|64)$/i) {
- push @deps, "platform:win32";
- } else {
+ if (!TeXLive::TLUtils::member(TeXLive::TLUtils::platform(), @archs)) {
+ # hmm that is bad, the platform as detected is not in the list
+ # of installed platforms, so the option --arch has to be given
+ # if only one is installed use that one
if ($#archs == 0) {
# only one arch available, fine, use it as default
push @deps, "platform:$archs[0]";
@@ -2557,7 +2511,7 @@ sub check_files {
# we need the -use-svn version only for the check-file-coverage
# replacement anyway, so it will be used on tug, which is neither w32 nor
# darwin.
- my $arch = $localtlpdb->option_platform;
+ my $arch = $localtlmedia->platform();
return $ret if ($arch eq "win32" || $arch eq "universal-darwin");
# do check that all files in the trees are covered
@@ -2920,8 +2874,7 @@ sub init_local_db {
die("cannot find tlpdb in $Master") unless (defined($localtlpdb));
# 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",
- $localtlpdb->option_platform)) {
+ if (!setup_programs("$Master/tlpkg/installer", $localtlmedia->platform)) {
tlwarn("Couldn't set up the necessary programs.\nInstallation of packages is not supported.\nPlease report to texlive\@tug.org.\n");
if (defined($should_i_die) && $should_i_die) {
finish(1);
@@ -2930,7 +2883,7 @@ sub init_local_db {
}
}
# let cmd line options override the settings in localtlpdb
- my $loc = $localtlpdb->option_location;
+ my $loc = $localtlpdb->option("location");
if (defined($loc)) {
$location = $loc;
}
@@ -3485,27 +3438,34 @@ written to the terminal.
=item B<option [show]>
+=item B<option showall>
+
=item B<option I<key> [I<value>]>
=back
The first form shows the global TeX Live settings currently saved in the
-TLPDB.
+TLPDB with a short description and the C<key> used for changing it in
+paranthesis.
+
+The second form acts like the first, but also shows options which can
+be defined but are not currently set to any value.
-In the second form, if I<value> is not given, the setting for I<key> is
+In the third form, if I<value> is not given, the setting for I<key> is
displayed. If I<value> is present, I<key> is set to I<value>.
-Possible values for I<key> are:
-
- C<location> (default installation location),
- C<formats> (create formats at installation time),
- C<docfiles> (install documentation files),
- C<srcfiles> (install source files),
- C<backupdir> (default directory for backups),
- C<autobackup> (number of backups to keep).
- C<sys_bin> (location where binaries are linked to by action symlinks)
- C<sys_man> (location where man pages are linked to by action symlinks)
- C<sys_info> (location where info pages are linked to by action symlinks)
+Possible values for I<key> are (but see B<tlmgr option showall> for
+the definitive list):
+
+ location (default installation location),
+ formats (create formats at installation time),
+ docfiles (install documentation files),
+ srcfiles (install source files),
+ backupdir (default directory for backups),
+ autobackup (number of backups to keep).
+ sys_bin (location where binaries are linked to by action symlinks)
+ sys_man (location where man pages are linked to by action symlinks)
+ sys_info (location where info pages are linked to by action symlinks)
One common use of C<option> is if you originally installed from DVD, and
want to permanently change the installation to get further updates from
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
index bc910bad907..c5746ac7954 100644
--- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl
@@ -10,42 +10,49 @@
our $back_config = $back->add("config",-label => ___"config");
$screens{"config"} = $back_config;
-my $default_location = $localtlpdb->option_location;
-my $default_formats = ($localtlpdb->option_create_formats ? ___"yes" : ___"no");
-my $default_docfiles = ($localtlpdb->option_install_docfiles ? ___"yes" : ___"no");
-my $default_srcfiles = ($localtlpdb->option_install_srcfiles ? ___"yes" : ___"no");
-my $default_backupdir = $localtlpdb->option("backupdir");
-my $default_autobackup = $localtlpdb->option("autobackup");
+my %defaults;
+for my $key (keys %TeXLive::TLConfig::TLPDBOptionTlmgrName) {
+ if ($TeXLive::TLConfig::TLPDBOptionType{$key} eq "b") {
+ $defaults{$key} = ($localtlpdb->option($key) ? ___"yes" : ___"no");
+ } else {
+ $defaults{$key} = $localtlpdb->option($key);
+ }
+}
# this will be loaded only on unix systems!
#
+my @config_set_l;
+my @config_set_m;
+my @config_set_r;
my $back_config_set = $back_config->Labelframe(-text => ___"defaultsettings");
$back_config_set->pack(-fill => "both", -padx => "2m", -pady => "2m");
-my $back_config_set_l1 = $back_config_set->Label(-text => ___"defaultsource", -anchor => "w");
-my $back_config_set_m1 = $back_config_set->Label(-textvariable => \$default_location);
-my $back_config_set_r1 = $back_config_set->Button(-text => ___"change",
+push @config_set_l,
+ $back_config_set->Label(-text => ___"defaultsource", -anchor => "w");
+push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{"location"});
+push @config_set_r,
+ $back_config_set->Button(-text => ___"change",
-command => sub { menu_default_location(); });
-my $back_config_set_l2 = $back_config_set->Label(-text => ___"createformats", -anchor => "w");
-my $back_config_set_m2 = $back_config_set->Label(-textvariable => \$default_formats);
-my $back_config_set_r2 = $back_config_set->Button(-text => ___"toggle",
- -command => sub { toggle_setting("formats"); });
-my $back_config_set_l3 = $back_config_set->Label(-text => ___"installdoc", -anchor => "w");
-my $back_config_set_m3 = $back_config_set->Label(-textvariable => \$default_docfiles);
-my $back_config_set_r3 = $back_config_set->Button(-text => ___"toggle",
- -command => sub { toggle_setting("docfiles"); });
-
-my $back_config_set_l4 = $back_config_set->Label(-text => ___"installsrc", -anchor => "w");
-my $back_config_set_m4 = $back_config_set->Label(-textvariable => \$default_srcfiles);
-my $back_config_set_r4 = $back_config_set->Button(-text => ___"toggle",
- -command => sub { toggle_setting("srcfiles"); });
+for my $key (qw/create_formats install_docfiles install_srcfiles/) {
+ push @config_set_l,
+ $back_config_set->Label(-text => ___($key), -anchor => "w");
+ push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{$key});
+ push @config_set_r,
+ $back_config_set->Button(-text => ___"toggle",
+ -command => sub { toggle_setting($key); });
+}
-my $back_config_set_l5 = $back_config_set->Label(-text => ___"backupdir", -anchor => "w");
-my $back_config_set_m5 = $back_config_set->Label(-textvariable => \$default_backupdir);
-my $back_config_set_r5 = $back_config_set->Button(-text => ___"change",
+push @config_set_l,
+ $back_config_set->Label(-text => ___"backupdir", -anchor => "w");
+push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{"backupdir"});
+push @config_set_r,
+ $back_config_set->Button(-text => ___"change",
-command => sub {
my $dir = $back_config->chooseDirectory();
if (defined($dir) && ($default_backupdir ne $dir)) {
@@ -56,23 +63,58 @@ my $back_config_set_r5 = $back_config_set->Button(-text => ___"change",
}
});
-my $back_config_set_l6 = $back_config_set->Label(-text => ___"autobackup", -anchor => "w");
-my $back_config_set_m6 = $back_config_set->Label(-textvariable => \$default_autobackup);
-my $back_config_set_r6 = $back_config_set->Button(-text => ___"change",
+push @config_set_l,
+ $back_config_set->Label(-text => ___"autobackup", -anchor => "w");
+push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{"autobackup"});
+push @config_set_r,
+ $back_config_set->Button(-text => ___"change",
-command => sub { select_autobackup($p); }, -anchor => "w");
-$back_config_set_l1->grid( $back_config_set_m1, $back_config_set_r1,
- -padx => "2m", -pady => "2m", -sticky => "nwe");
-$back_config_set_l2->grid( $back_config_set_m2, $back_config_set_r2,
- -padx => "2m", -pady => "2m", -sticky => "nwe");
-$back_config_set_l3->grid( $back_config_set_m3, $back_config_set_r3,
- -padx => "2m", -pady => "2m", -sticky => "nwe");
-$back_config_set_l4->grid( $back_config_set_m4, $back_config_set_r4,
- -padx => "2m", -pady => "2m", -sticky => "nwe");
-$back_config_set_l5->grid( $back_config_set_m5, $back_config_set_r5,
- -padx => "2m", -pady => "2m", -sticky => "nwe");
-$back_config_set_l6->grid( $back_config_set_m6, $back_config_set_r6,
- -padx => "2m", -pady => "2m", -sticky => "nwe");
+if (!win32()) {
+ for my $key (qw/sys_bin sys_info sys_man/) {
+ push @config_set_l,
+ $back_config_set->Label(-text => ___($key), -anchor => "w");
+ push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{$key});
+ push @config_set_r,
+ $back_config_set->Button(-text => ___"change",
+ -command => sub {
+ my $dir = $back_config->chooseDirectory();
+ if (defined($dir) && ($defaults{$key} ne $dir)) {
+ # see warning concerning UTF8 or other encoded dir names!!
+ $localtlpdb->option($key, $dir);
+ $defaults{$key} = $dir;
+ $localtlpdb->save;
+ }
+ });
+ }
+}
+
+if (win32()) {
+ for my $key (qw/desktop_integration file_assocs w32_multi_user/) {
+ push @config_set_l,
+ $back_config_set->Label(-text => ___($key), -anchor => "w");
+ push @config_set_m,
+ $back_config_set->Label(-textvariable => \$defaults{$key});
+ push @config_set_r,
+ $back_config_set->Button(-text => ___"change",
+ -command => sub {
+ my $dir = $back_config->chooseDirectory();
+ if (defined($dir) && ($defaults{$key} ne $dir)) {
+ # see warning concerning UTF8 or other encoded dir names!!
+ $localtlpdb->option($key, $dir);
+ $defaults{$key} = $dir;
+ $localtlpdb->save;
+ }
+ });
+ }
+}
+
+for my $i (0..$#config_set_l) {
+ $config_set_l[$i]->grid( $config_set_m[$i], $config_set_r[$i],
+ -padx => "1m", -pady => "1m", -sticky => "nwe");
+}
#############
@@ -183,6 +225,26 @@ $back_config_act->Button(-text => ___"updatemaps",
})->pack(-expand => 1, -fill => "x",
-padx => "2m", -pady => "2m");
+if (!win32()) {
+ $back_config_act->Button(-text => ___"updatesymlinks",
+ -command => sub {
+ $mw->Busy(-recurse => 1);
+ info("Updating symlinks ...\n");
+ $localtlmedia->add_symlinks();
+ $mw->Unbusy;
+ })->pack(-expand => 1, -fill => "x",
+ -padx => "2m", -pady => "2m");
+
+ $back_config_act->Button(-text => ___"removesymlinks",
+ -command => sub {
+ $mw->Busy(-recurse => 1);
+ info("Updating symlinks ...\n");
+ $localtlmedia->remove_symlinks();
+ $mw->Unbusy;
+ })->pack(-expand => 1, -fill => "x",
+ -padx => "2m", -pady => "2m");
+}
+
$back_config_act->pack(-side => 'right', -fill => "both", -padx => "2m", -pady => "2m", -expand => 1, -ipadx => "2m", -ipady => "2m");
@@ -218,7 +280,7 @@ sub menu_default_location {
my $f = $sw->Frame;
my $okbutton = $f->Button(-text => ___"ok",
-command => sub { $default_location = $entry->get;
- $localtlpdb->option_location($default_location);
+ $localtlpdb->option("location", $default_location);
$localtlpdb->save;
$sw->destroy })->pack(-side => 'left',-padx => "2m", -pady => "2m");
my $cancelbutton = $f->Button(-text => ___"cancel",
@@ -230,19 +292,9 @@ sub menu_default_location {
sub toggle_setting() {
my ($key) = @_;
- if ($key eq "formats") {
- my $new = ($localtlpdb->option_create_formats ? 0 : 1);
- $localtlpdb->option_create_formats($new);
- $default_formats = ($new ? ___"yes" : ___"no");
- } elsif ($key eq "srcfiles") {
- my $new = ($localtlpdb->option_install_srcfiles ? 0 : 1);
- $localtlpdb->option_install_srcfiles($new);
- $default_srcfiles = ($new ? ___"yes" : ___"no");
- } elsif ($key eq "docfiles") {
- my $new = ($localtlpdb->option_install_docfiles ? 0 : 1);
- $localtlpdb->option_install_docfiles($new);
- $default_docfiles = ($new ? ___"yes" : ___"no");
- }
+ my $new = ($localtlpdb->option($key) ? 0 : 1);
+ $localtlpdb->option($key, $new);
+ $defaults{$key} = ($new ? ___"yes" : ___"no");
$localtlpdb->save;
}
@@ -281,7 +333,7 @@ sub select_autobackup {
my $foo = $back_config->Toplevel(-title => ___"autobackup");
$foo->transient($mw);
$foo->grab();
- my $var = $default_autobackup;
+ my $var = $defaults{"autobackup"};
my $opt = $foo->BrowseEntry(-label => ___"autobackup",
-variable => \$var);
my @al;
@@ -299,7 +351,7 @@ sub select_autobackup {
-command => sub {
$var =~ s/ .*$//;
$localtlpdb->option("autobackup", $var);
- $default_autobackup = $var;
+ $defaults{"autobackup"} = $var;
$localtlpdb->save;
$foo->destroy;
}
diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
index f06a35c393d..dae5c3f3460 100755
--- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
+++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl
@@ -42,7 +42,7 @@ $TRANS{'en'} = {
newdefaultsrc => "New default installation source",
choosedir => "Choose Directory",
config => "Configuration",
- createformats => "Create formats on installation",
+ create_formats => "Create formats on installation",
currentsource => "Current installation source: ",
debug => "Debug",
defaultsource => "Default installation source",
@@ -55,8 +55,13 @@ $TRANS{'en'} = {
nodepballoon => "For collections: install or remove will not install/remove the dependencies",
infoitem => "Information on the selected item",
install => "Installation",
- installdoc => "Install macro/font docs",
- installsrc => "Install macro/font sources",
+ install_docfiles => "Install macro/font docs",
+ install_srcfiles => "Install macro/font sources",
+ sys_bin => "Link destination for programs",
+ sys_man => "Link destination for man pages",
+ sys_info => "Link destination for info docs",
+ updatesymlinks => "Update symbolic links",
+ removesymlinks => "Remove symbolic links",
installsel => "Install selected",
load => "Load",
warningtxt => "The database of the installation source has not been loaded.\n\nPlease use the \"Load\" (and possibly \"Change\") button to do so.",
@@ -225,9 +230,9 @@ die("cannot find tlpdb!") unless (defined($localtlpdb));
our @alllocalpackages = setup_list(0,$localtlpdb->list_packages);
our @updatepackages;
-setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform);
+setup_programs("$Master/tlpkg/installer", $localtlmedia->platform);
-my $loc = $localtlpdb->option_location;
+my $loc = $localtlpdb->option("location");
if (defined($loc)) {
$location = $loc;
}
diff --git a/Master/texmf/scripts/texlive/uninstall-win32.pl b/Master/texmf/scripts/texlive/uninstall-win32.pl
index 01b7a85a4b5..cfc3ff9bee1 100644
--- a/Master/texmf/scripts/texlive/uninstall-win32.pl
+++ b/Master/texmf/scripts/texlive/uninstall-win32.pl
@@ -49,17 +49,22 @@ sub doit {
if (!defined($localtlpdb)) {
tlwarn("Cannot load the TLPDB from $Master, are you sure there is an installation?\n");
} else {
+ # set the mode for windows uninstall according to the setting in
+ # tlpdb
+ if (TeXLive::TLWinGoo::admin() && !$localtlpdb->option("w32_multi_user")) {
+ non_admin();
+ }
for my $pkg ($localtlpdb->list_packages) {
&TeXLive::TLUtils::do_postaction("remove", $localtlpdb->get_package($pkg),
- $localtlpdb->option_file_assocs,
- $localtlpdb->option_desktop_integration,
- $localtlpdb->option_post_code);
+ $localtlpdb->option("file_assocs"),
+ $localtlpdb->option("desktop_integration"),
+ $localtlpdb->option("post_code"));
}
}
my $menupath = &TeXLive::TLWinGoo::menu_path();
$menupath =~ s!/!\\!g;
`rmdir /q "$menupath\\$TeXLive::TLConfig::WindowsMainMenuName" 2>nul`;
- my $mode = ($localtlpdb->option_w32_multi_user) ? 'system' : 'user';
+ my $mode = ($localtlpdb->option("w32_multi_user")) ? 'system' : 'user';
adjust_reg_path_for_texlive('remove', "$Master/bin/win32", $mode);
# unsetenv_reg("TEXBINDIR");
# from_dvd case:
diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm
index eca234e5c96..536cbc33a50 100644
--- a/Master/tlpkg/TeXLive/TLConfig.pm
+++ b/Master/tlpkg/TeXLive/TLConfig.pm
@@ -32,6 +32,11 @@ BEGIN {
$WindowsMainMenuName
$RelocPrefix
$RelocTree
+ %TLPDBSettingType
+ %TLPDBSettingDesc
+ %TLPDBOptionType
+ %TLPDBOptionDesc
+ %TLPDBOptionTlmgrName
);
@EXPORT = @EXPORT_OK;
}
@@ -98,8 +103,76 @@ our @AllowedConfigOptions = qw/
autobackup
/;
+#
+# definition of the option strings and their value types
+# possible types are:
+# - u: url
+# - b: boolean, saved as 0/1
+# - p: path (local path)
+# - n: naturnal number
+# it allows n:[a]..[b]
+# if a is empty start at -infty
+# if b is empty end at +infty
+# so "n:.." is equivalent to "n"
+
+# WARNING: keep these in sync!
+#
+our %TLPDBOptionTlmgrName = (
+ "location" => "location",
+ "create_formats" => "formats",
+ "desktop_integration" => "deskint",
+ "file_assocs" => "fileassocs",
+ "post_code" => "postcode",
+ "sys_bin" => "sys_bin",
+ "sys_info" => "sys_info",
+ "sys_man" => "sys_man",
+ "install_docfiles" => "docfiles",
+ "install_srcfiles" => "srcfiles",
+ "w32_multi_user" => "multiuser",
+ "autobackup" => "autobackup",
+ "backupdir" => "backupdir");
+our %TLPDBOptionType = (
+ "location" => "u",
+ "create_formats" => "b",
+ "desktop_integration" => "b",
+ "file_assocs" => "b",
+ "post_code" => "b",
+ "sys_bin" => "p",
+ "sys_info" => "p",
+ "sys_man" => "p",
+ "install_docfiles" => "b",
+ "install_srcfiles" => "b",
+ "w32_multi_user" => "b",
+ "autobackup" => "n:-1..",
+ "backupdir" => "p");
+our %TLPDBOptionDesc = (
+ "location" => "Default installation location",
+ "create_formats" => "Create formats on installation",
+ "desktop_integration" => "Create shortcuts (menu and desktop) in postinst",
+ "file_assocs" => "Change file associations in postinst",
+ "post_code" => "Run postinst code blobs",
+ "sys_bin" => "Destination for symlinks for binaries",
+ "sys_info" => "Destination for symlinks for info docs",
+ "sys_man" => "Destination for symlinks for man pages",
+ "install_docfiles" => "Install documentation files",
+ "install_srcfiles" => "Install source files",
+ "w32_multi_user" => "Install for shortcuts/menu items for all users (w32)",
+ "autobackup" => "Number of backups to keep",
+ "backupdir" => "Directory for backups");
+
+our %TLPDBSettingType = (
+ "platform" => "s",
+ "available_architectures" => "l"
+);
+our %TLPDBSettingDesc = (
+ "platform" => "Main platform for this computer",
+ "available_architectures" => "All available/installed architectures"
+);
+
+
our $WindowsMainMenuName = "TeX Live $ReleaseYear";
+
1;
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm
index 90af2763348..6980f813959 100644
--- a/Master/tlpkg/TeXLive/TLMedia.pm
+++ b/Master/tlpkg/TeXLive/TLMedia.pm
@@ -11,6 +11,7 @@ use TeXLive::TLConfig;
use TeXLive::TLUtils qw(copy win32 dirname mkdirhier basename download_file
merge_into debug ddebug info tlwarn log);
use TeXLive::TLPDB;
+use TeXLive::TLWinGoo;
sub new
{
@@ -137,8 +138,8 @@ sub install_package {
my $container_src_split = $fromtlpdb->config_src_container;
my $container_doc_split = $fromtlpdb->config_doc_container;
# get options about src/doc splitting from $totlpdb
- my $opt_src = $totlpdb->option_install_srcfiles;
- my $opt_doc = $totlpdb->option_install_docfiles;
+ my $opt_src = $totlpdb->option("install_srcfiles");
+ my $opt_doc = $totlpdb->option("install_docfiles");
my $real_opt_doc = $opt_doc;
if ($tlpobj->category =~ m/documentation/i) {
# we do install documenation files for category Documentation
@@ -258,10 +259,15 @@ sub install_package {
# do the postinstallation actions
#
# Run the post installation code in the postaction tlpsrc entries
+ # in case we are on w32 and the admin did install for himself only
+ # we switch off admin mode
+ if (win32() && admin() && !$totlpdb->option("w32_multi_user")) {
+ non_admin();
+ }
&TeXLive::TLUtils::do_postaction("install", $tlpobj,
- $totlpdb->option_file_assocs,
- $totlpdb->option_desktop_integration,
- $totlpdb->option_post_code);
+ $totlpdb->option("file_assocs"),
+ $totlpdb->option("desktop_integration"),
+ $totlpdb->option("post_code"));
}
}
return 1;
@@ -454,7 +460,7 @@ sub remove_package {
&TeXLive::TLUtils::do_postaction("remove", $tlp,
0, # option_file_assocs,
0, # option_desktop_integration,
- $localtlpdb->option_post_code);
+ $localtlpdb->option("post_code"));
}
#
my @removals = &TeXLive::TLUtils::removed_dirs (@goodfiles);
@@ -474,17 +480,147 @@ sub remove_package {
$localtlpdb->save;
#
# Run the post installation code in the postaction tlpsrc entries
+ # in case we are on w32 and the admin did install for himself only
+ # we switch off admin mode
+ if (win32() && admin() && !$localtlpdb->option("w32_multi_user")) {
+ non_admin();
+ }
+ #
+ # Run the post installation code in the postaction tlpsrc entries
# the postaction code part cannot be evaluated now since the
# files are already removed.
if (!$nopostinstall) {
&TeXLive::TLUtils::do_postaction("remove", $tlp,
- $localtlpdb->option_file_assocs,
- $localtlpdb->option_desktop_integration,
+ $localtlpdb->option("file_assocs"),
+ $localtlpdb->option("desktop_integration"),
0);
}
}
return 1;
}
+
+
+=pod
+
+=item C<< $tlmedia->add_symlinks() >>
+=item C<< $tlmedia->remove_symlinks() >>
+
+These two functions try to create/remove symlinks for binaries, man pages,
+and info files as specified by the options saved in the respective tlpdb
+($tlpdb->option("sys_bin"), $tlpdb->option("sys_man"),
+$tlpdb->option("sys_info")).
+
+The functions return 1 on success and 0 on error.
+On Windows it returns undefined.
+
+=cut
+
+sub add_link_dir_dir {
+ my ($from, $to) = @_;
+ mkdirhier $to;
+ if (-w $to) {
+ debug("linking files from $from to $to\n");
+ chomp (@files = `ls "$from"`);
+ my $ret = 1;
+ for my $f (@files) {
+ unlink("$to/$f");
+ if (system("ln -s \"$from/$f\" \"$to\"")) {
+ tlwarn("Linking $f from $from to $to failed: $!\n");
+ $ret = 0;
+ }
+ }
+ return $ret;
+ } else {
+ tlwarn("destination $to not writable, no linking files in $from done.\n");
+ return 0;
+ }
+}
+
+sub remove_link_dir_dir {
+ my ($from, $to) = @_;
+ if ((-d "$to") && (-w "$to")) {
+ debug("removing links from $from to $to\n");
+ chomp (@files = `ls "$from"`);
+ my $ret = 1;
+ foreach my $f (@files) {
+ next if (! -r "$to/$f");
+ if ((-l "$to/$f") &&
+ (readlink("$to/$f") =~ m;^$from/;)) {
+ $ret = 0 unless unlink("$to/$f");
+ } else {
+ $ret = 0;
+ tlwarn ("not removing $to/$f, not a link or wrong destination!\n");
+ }
+ }
+ # trry to remove the destination directory, it might be empty and
+ # we might have write permissions, ignore errors
+ `rmdir "$to" 2>/dev/null`;
+ return $ret;
+ } else {
+ tlwarn ("destination $to not writable, no removal of links done!\n");
+ return 0;
+ }
+}
+
+sub add_remove_symlinks {
+ my $self = shift;
+ my $mode = shift;
+ my $errors = 0;
+ my $Master = $self->location;
+ my $arch = $self->platform();
+ my $plat_bindir = "$Master/bin/$arch";
+ return if win32();
+ $sys_bin = $self->tlpdb->option("sys_bin");
+ $sys_man = $self->tlpdb->option("sys_man");
+ $sys_info= $self->tlpdb->option("sys_info");
+ if ($mode eq "add") {
+ $errors++ unless add_link_dir_dir($plat_bindir, $sys_bin);
+ if (-d "$Master/texmf/doc/info") {
+ $errors++ unless add_link_dir_dir("$Master/texmf/doc/info", $sys_info);
+ }
+ } elsif ($mode eq "remove") {
+ $errors++ unless remove_link_dir_dir($plat_bindir, $sys_bin);
+ if (-d "$Master/texmf/doc/info") {
+ $errors++ unless remove_link_dir_dir("$Master/texmf/doc/info", $sys_info);
+ }
+ } else {
+ die ("should not happen, unknown mode $mode in add_remove_symlinks!");
+ }
+ mkdirhier $sys_man if ($mode eq "add");
+ if (-w $sys_man && -d "$Master/texmf/doc/man") {
+ debug("$mode symlinks for man pages in $sys_man\n");
+ my $foo = `(cd "$Master/texmf/doc/man" && echo *)`;
+ chomp (my @mans = split (' ', $foo));
+ foreach my $m (@mans) {
+ my $mandir = "$Master/texmf/doc/man/$m";
+ next unless -d $mandir;
+ if ($mode eq "add") {
+ $errors++ unless add_link_dir_dir($mandir, "$sys_man/$m");
+ } else {
+ $errors++ unless remove_link_dir_dir($mandir, "$sys_man/$m");
+ }
+ }
+ `rmdir "$sys_man" 2>/dev/null` if ($mode eq "remove");
+ } else {
+ tlwarn("destination of man symlink $sys_man not writable, "
+ . "cannot $mode symlinks.\n");
+ $errors++;
+ }
+ # we collected errors in $ret, so return the negation of it
+ if ($errors) {
+ info("$mode of symlinks failed $errors times, please see above messages.\n");
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+sub add_symlinks {
+ return (shift->add_remove_symlinks("add", @_));
+}
+sub remove_symlinks {
+ return (shift->add_remove_symlinks("remove", @_));
+}
# member access functions
@@ -500,6 +636,22 @@ sub lang_doc_collections { my $self = shift; return @{ $self->{'lang_doc_collect
sub schemes { my $self = shift; return @{ $self->{'schemes'} }; }
sub systems { my $self = shift; return @{ $self->{'systems'} }; }
+# deduce the platform of the referenced media as follows:
+# - if the $tlpdb->setting("platform") is there it overrides the detected
+# setting
+# - if it is not there call TLUtils::platform()
+sub platform {
+ # try to deduce the platform
+ my $self = shift;
+ my $tlpdb = $self->tlpdb;
+ if (defined($tlpdb)) {
+ my $ret = $tlpdb->setting("platform");
+ return $ret if defined $ret;
+ }
+ # the platform setting wasn't found in the tlpdb, try TLUtils::platform
+ return TeXLive::TLUtils::platform();
+}
+
1;
__END__
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index b826db38e73..5c65d57f726 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -49,9 +49,10 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages
$tlpdb->config_container_format;
$tlpdb->config_release;
$tlpdb->config_revision;
+ $tlpdb->options;
$tlpdb->option($key, [$value]);
- $tlpdb->add_symlinks();
- $tlpdb->remove_symlinks();
+ $tlpdb->settings;
+ $tlpdb->setting($key, [$value]);
$tlpdb->sizes_of_packages($opt_src, $opt_doc [, @packs ]);
TeXLive::TLPDB->listdir([$dir]);
@@ -62,7 +63,8 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages
=cut
use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory $InfraLocation
- $DatabaseName $MetaCategoriesRegexp $Archive);
+ $DatabaseName $MetaCategoriesRegexp $Archive
+ %TLPDBOptionType %TLPDBSettingType);
use TeXLive::TLUtils qw(dirname mkdirhier member win32 info debug ddebug
tlwarn);
use TeXLive::TLPOBJ;
@@ -328,13 +330,13 @@ sub save {
The C<available_architectures> functions returns the list of available
architectures as set in the options section
-(i.e., using option_available_architectures)
+(i.e., using setting("available_architectures"))
=cut
sub available_architectures {
my $self = shift;
- my @archs = $self->option_available_architectures;
+ my @archs = $self->setting("available_architectures");
if (! @archs) {
# fall back to the old method checking tex\.*
my @packs = $self->list_packages;
@@ -918,123 +920,6 @@ sub config_revision {
=pod
-=item C<< $tlpdb->add_symlinks() >>
-=item C<< $tlpdb->remove_symlinks() >>
-
-These two functions try to create/remove symlinks for binaries, man pages,
-and info files as specified by the options saved in the tlpdb
-($tlpdb->option_sys_bin, $tlpdb->option_sys_man, $tlpdb->option_sys_info).
-
-The functions return 1 on success and 0 on error.
-On Windows it returns undefined.
-
-=cut
-
-sub add_link_dir_dir {
- my ($from, $to) = @_;
- mkdirhier $to;
- if (-w $to) {
- debug("linking files from $from to $to\n");
- chomp (@files = `ls "$from"`);
- my $ret = 1;
- for my $f (@files) {
- unlink("$to/$f");
- if (system("ln -s \"$from/$f\" \"$to\"")) {
- tlwarn("Linking $f from $from to $to failed: $!\n");
- $ret = 0;
- }
- }
- return $ret;
- } else {
- tlwarn("destination $to not writable, no linking files in $from done.\n");
- return 0;
- }
-}
-
-sub remove_link_dir_dir {
- my ($from, $to) = @_;
- if ((-d "$to") && (-w "$to")) {
- debug("removing links from $from to $to\n");
- chomp (@files = `ls "$from"`);
- my $ret = 1;
- foreach my $f (@files) {
- next if (! -r "$to/$f");
- if ((-l "$to/$f") &&
- (readlink("$to/$f") =~ m;^$from/;)) {
- $ret = 0 unless unlink("$to/$f");
- } else {
- $ret = 0;
- tlwarn ("not removing $to/$f, not a link or wrong destination!\n");
- }
- }
- # trry to remove the destination directory, it might be empty and
- # we might have write permissions, ignore errors
- `rmdir "$to" 2>/dev/null`;
- return $ret;
- } else {
- tlwarn ("destination $to not writable, no removal of links done!\n");
- return 0;
- }
-}
-
-sub add_remove_symlinks {
- my $self = shift;
- my $mode = shift;
- my $errors = 0;
- my $Master = $self->{'root'};
- my $arch = $self->option_platform;
- my $plat_bindir = "$Master/bin/$arch";
- return if win32();
- $sys_bin = $self->option_sys_bin;
- $sys_man = $self->option_sys_man;
- $sys_info= $self->option_sys_info;
- if ($mode eq "add") {
- $errors++ unless add_link_dir_dir($plat_bindir, $sys_bin);
- $errors++ unless add_link_dir_dir("$Master/texmf/doc/info", $sys_info);
- } elsif ($mode eq "remove") {
- $errors++ unless remove_link_dir_dir($plat_bindir, $sys_bin);
- $errors++ unless remove_link_dir_dir("$Master/texmf/doc/info", $sys_info);
- } else {
- die ("should not happen, unknown mode $mode in add_remove_symlinks!");
- }
- mkdirhier $sys_man if ($mode eq "add");
- if (-w $sys_man) {
- debug("$mode symlinks for man pages in $sys_man\n");
- my $foo = `(cd "$Master/texmf/doc/man" && echo *)`;
- chomp (my @mans = split (' ', $foo));
- foreach my $m (@mans) {
- my $mandir = "$Master/texmf/doc/man/$m";
- next unless -d $mandir;
- if ($mode eq "add") {
- $errors++ unless add_link_dir_dir($mandir, "$sys_man/$m");
- } else {
- $errors++ unless remove_link_dir_dir($mandir, "$sys_man/$m");
- }
- }
- `rmdir "$sys_man" 2>/dev/null` if ($mode eq "remove");
- } else {
- tlwarn("destination of man symlink $sys_man not writable, "
- . "cannot $mode symlinks.\n");
- $errors++;
- }
- # we collected errors in $ret, so return the negation of it
- if ($errors) {
- info("$mode of symlinks failed $errors times, please see above messages.\n");
- return 0;
- } else {
- return 1;
- }
-}
-
-sub add_symlinks {
- return (shift->add_remove_symlinks("add", @_));
-}
-sub remove_symlinks {
- return (shift->add_remove_symlinks("remove", @_));
-}
-
-=pod
-
=item C<< $tlpdb->sizes_of_packages ( $opt_src, $opt_doc, [ @packs ] ) >>
This function returns a reference to a hash with package names as keys
@@ -1103,8 +988,8 @@ sub sizes_of_packages {
=pod
-=item C<< $tlpdb->option_XXXXX >ize += $tlpsizes{$p};
-
+=item C<< $tlpdb->option($key [, $val]) >>
+=item C<< $tlpdb->setting($key [, $val]) >>
Need to be documented
@@ -1112,29 +997,34 @@ Need to be documented
sub _set_option_value {
my $self = shift;
- $self->_set_option_value_pkg('00texlive.installation', @_);
+ $self->_set_value_pkg('00texlive.installation', 'opt_', @_);
+}
+sub _set_setting_value {
+ my $self = shift;
+ $self->_set_value_pkg('00texlive.installation', 'setting_', @_);
}
-sub _set_option_value_pkg {
- my ($self,$pkgname,$key,$value) = @_;
+sub _set_value_pkg {
+ my ($self,$pkgname,$pre,$key,$value) = @_;
+ my $k = "$pre$key";
my $pkg = $self->{'tlps'}{$pkgname};
my @newdeps;
if (!defined($pkg)) {
$pkg = new TeXLive::TLPOBJ;
$pkg->name($pkgname);
$pkg->category("TLCore");
- push @newdeps, "$key:$value";
+ push @newdeps, "$k:$value";
} else {
my $found = 0;
foreach my $d ($pkg->depends) {
- if ($d =~ m!^$key:!) {
+ if ($d =~ m!^$k:!) {
$found = 1;
- push @newdeps, "$key:$value";
+ push @newdeps, "$k:$value";
} else {
push @newdeps, $d;
}
}
if (!$found) {
- push @newdeps, "$key:$value";
+ push @newdeps, "$k:$value";
}
}
$pkg->depends(@newdeps);
@@ -1143,14 +1033,20 @@ sub _set_option_value_pkg {
sub _option_value {
my $self = shift;
- $self->_option_value_pkg('00texlive.installation', @_);
+ $self->_value_pkg('00texlive.installation', 'opt_', @_);
}
-sub _option_value_pkg {
- my ($self,$pkg,$key) = @_;
+sub _setting_value {
+ my $self = shift;
+ $self->_value_pkg('00texlive.installation', 'setting_', @_);
+}
+
+sub _value_pkg {
+ my ($self,$pkg,$pre,$key) = @_;
+ my $k = "$pre$key";
if (defined($self->{'tlps'}{$pkg})) {
foreach my $d ($self->{'tlps'}{$pkg}->depends) {
- if ($d =~ m!^$key:(.*)$!) {
+ if ($d =~ m!^$k:(.*)$!) {
return "$1";
}
}
@@ -1160,117 +1056,113 @@ sub _option_value_pkg {
return;
}
-sub option {
- my $self = shift;
- my $key = shift;
- if (@_) { $self->_set_option_value($key, shift); }
- return $self->_option_value($key);
-}
-
sub option_pkg {
my $self = shift;
my $pkg = shift;
my $key = shift;
- if (@_) { $self->_set_option_value_pkg($pkg, $key, shift); }
- return $self->_option_value_pkg($pkg, $key);
-}
-
-# TODO the above function should be used in the functions below as
-# far as possible ...
-
-sub option_available_architectures {
- my $self = shift;
- if (@_) { $self->_set_option_value("available_architectures","@_"); }
-
- # sadly, if the tlpdb is messed up, there may be no architectures.
- my $val = $self->_option_value("available_architectures");
- my @archs;
- if (defined $val) {
- @archs = split(" ", $val);
- } else {
- warn "no available_architectures, continuing anyway ...";
- @archs = ();
+ if (@_) { $self->_set_value_pkg($pkg, "opt_", $key, shift); }
+ my $ret = $self->_value_pkg($pkg, "opt_", $key);
+ # special case for location == __MASTER__
+ if ($ret eq "__MASTER__" && $key eq "location") {
+ return $self->root;
}
- return @archs;
-}
-sub option_create_symlinks {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_create_symlinks", shift); }
- return $self->_option_value("opt_create_symlinks");
-}
-sub option_desktop_integration {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_desktop_integration", shift); }
- return $self->_option_value("opt_desktop_integration");
-}
-sub option_file_assocs {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_file_assocs", shift); }
- return $self->_option_value("opt_file_assocs");
-}
-sub option_post_code {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_post_code", shift); }
- return $self->_option_value("opt_post_code");
-}
-sub option_path {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_path", shift); }
- return $self->_option_value("opt_path");
-}
-sub option_w32_multi_user {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_w32_multi_user", shift); }
- return $self->_option_value("opt_w32_multi_user");
-}
-sub option_install_docfiles {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_install_docfiles", shift); }
- return $self->_option_value("opt_install_docfiles");
+ return $ret;
}
-sub option_install_srcfiles {
+sub option {
my $self = shift;
- if (@_) { $self->_set_option_value("opt_install_srcfiles", shift); }
- return $self->_option_value("opt_install_srcfiles");
-}
-sub option_create_formats {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_create_formats", shift); }
- return $self->_option_value("opt_create_formats");
-}
-sub option_paper {
- my $self = shift;
- if (@_) { $self->_set_option_value("opt_paper", shift); }
- return $self->_option_value("opt_paper");
-}
-sub option_location {
- my $self = shift;
- if (@_) { $self->_set_option_value("location", shift); }
- my $loc = $self->_option_value("location");
- if ($loc eq "__MASTER__") {
+ my $key = shift;
+ if (@_) { $self->_set_option_value($key, shift); }
+ my $ret = $self->_option_value($key);
+ # special case for location == __MASTER__
+ if (defined($ret) && $ret eq "__MASTER__" && $key eq "location") {
return $self->root;
}
- return $self->_option_value("location");
+ return $ret;
}
-sub option_sys_bin {
+sub setting_pkg {
my $self = shift;
- if (@_) { $self->_set_option_value("opt_sys_bin", shift); }
- return $self->_option_value("opt_sys_bin");
+ my $pkg = shift;
+ my $key = shift;
+ if (@_) {
+ if ($TLPDBSettingType{$key} eq "l") {
+ $self->_set_value_pkg($pkg, "setting_", $key, "@_");
+ } else {
+ $self->_set_value_pkg($pkg, "setting_", $key, shift);
+ }
+ }
+ my $ret = $self->_value_pkg($pkg, "setting_", $key);
+ # check the types of the settings, and if it is a "l" return a list
+ if ($TLPDBSettingType{$key} eq "l") {
+ my @ret;
+ if (defined $ret) {
+ @ret = split(" ", $ret);
+ } else {
+ tlwarn "TLPDB::setting: no $key, returning empty list ...\n";
+ @ret = ();
+ }
+ return @ret;
+ }
+ return $ret;
}
-sub option_sys_man {
+sub setting {
my $self = shift;
- if (@_) { $self->_set_option_value("opt_sys_man", shift); }
- return $self->_option_value("opt_sys_man");
+ my $key = shift;
+ if (@_) {
+ if ($TLPDBSettingType{$key} eq "l") {
+ $self->_set_setting_value($key, "@_");
+ } else {
+ $self->_set_setting_value($key, shift);
+ }
+ }
+ my $ret = $self->_setting_value($key);
+ # check the types of the settings, and if it is a "l" return a list
+ if ($TLPDBSettingType{$key} eq "l") {
+ my @ret;
+ if (defined $ret) {
+ @ret = split(" ", $ret);
+ } else {
+ tlwarn "TLPDB::setting: no $key, returning empty list ...\n";
+ @ret = ();
+ }
+ return @ret;
+ }
+ return $ret;
+}
+
+=pod
+
+=item C<< $tlpdb->options >>
+
+Returns a reference to a hash with option names.
+
+=cut
+
+sub _keyshash {
+ my ($self, $pre, $hr) = @_;
+ my @allowed = keys %$hr;
+ my %ret;
+ my $pkg = $self->{'tlps'}{'00texlive.installation'};
+ if (defined($pkg)) {
+ foreach my $d ($pkg->depends) {
+ if ($d =~ m!^$pre([^:]*):(.*)!) {
+ if (member($1, @allowed)) {
+ $ret{$1} = $2;
+ } else {
+ tlwarn("Unsupported option/setting $d\n");
+ }
+ }
+ }
+ }
+ return \%ret;
}
-sub option_sys_info {
+
+sub options {
my $self = shift;
- if (@_) { $self->_set_option_value("opt_sys_info", shift); }
- return $self->_option_value("opt_sys_info");
+ return ($self->_keyshash('opt_', \%TLPDBOptionType));
}
-sub option_platform {
+sub settings {
my $self = shift;
- if (@_) { $self->_set_option_value("platform", shift); }
- return $self->_option_value("platform");
+ return ($self->_keyshash('setting_', \%TLPDBSettingType));
}
=pod
diff --git a/Master/tlpkg/bin/tl-update-tlnet b/Master/tlpkg/bin/tl-update-tlnet
index ca36dfc7633..33e2056945e 100755
--- a/Master/tlpkg/bin/tl-update-tlnet
+++ b/Master/tlpkg/bin/tl-update-tlnet
@@ -111,7 +111,7 @@ option_doc 1
option_fmt 1
option_letter 0
option_src 1
-option_symlinks 0
+option_path 0
" >texlive.profile
echo "$0: Running test install (log: `pwd`/install.log)..."
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index d3ccd808146..9b6b5c3c2eb 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -186,7 +186,8 @@ sub create_tlpdb
}
$tldb->root ($opt_master);
# do set the option_archs from the dirs in Master/bin
- $tldb->option_available_architectures ($tltree->architectures);
+ my @archs = $tltree->architectures;
+ $tldb->setting("available_architectures", @archs);
return($tldb, $src_count);
}
diff --git a/Master/tlpkg/bin/tlpsrc2tlpdb b/Master/tlpkg/bin/tlpsrc2tlpdb
index 370aa0bbc9f..59643fc2273 100755
--- a/Master/tlpkg/bin/tlpsrc2tlpdb
+++ b/Master/tlpkg/bin/tlpsrc2tlpdb
@@ -134,7 +134,8 @@ sub main
if ($opt_all) {
$tldb->root ($opt_master);
# do set the option_archs from the dirs in Master/bin
- $tldb->option_available_architectures ($tltree->architectures);
+ my @archs = $tltree->architectures;
+ $tldb->setting("available_architectures", @archs);
$tldb->save;
info ("$0: wrote $src_count packages to ". $tldb->root . ".\n");
} else {
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
index c9440b15c4f..e2ab24f0083 100644
--- a/Master/tlpkg/installer/install-menu-perltk.pl
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -627,9 +627,9 @@ sub menu_select_symlink {
our $osym = $vars{'option_path'};
our ($binlab,$binb,$manlab,$manb,$infolab,$infob);
sub set_unset_buttons {
- $lbin = ($osym ? $vars{'sys_bin'} : '');
- $linfo = ($osym ? $vars{'sys_info'} : '');
- $lman = ($osym ? $vars{'sys_man'} : '');
+ $lbin = ($osym ? $vars{'option_sys_bin'} : '');
+ $linfo = ($osym ? $vars{'option_sys_info'} : '');
+ $lman = ($osym ? $vars{'option_sys_man'} : '');
if ($osym) {
$binlab->grid(-row => 2, -column => 1, -sticky => "w", -padx => "2m");
$binb->grid(-row => 2, -column => 2, -sticky => "ew", -padx => "2m");
@@ -654,9 +654,9 @@ sub menu_select_symlink {
$lbin =~ s/^~/$home/;
$linfo =~ s/^~/$home/;
$lman =~ s/^~/$home/;
- $vars{'sys_bin'} = $lbin;
- $vars{'sys_info'} = $linfo;
- $vars{'sys_man'} = $lman;
+ $vars{'option_sys_bin'} = $lbin;
+ $vars{'option_sys_info'} = $linfo;
+ $vars{'option_sys_man'} = $lman;
}
$vars{'option_path'} = $osym;
toggle_and_set_opt_variable(\$vars{'option_path'}, \$pathadjyesno);
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index d9871ed9e4e..5fcaa2ecda7 100755
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -698,13 +698,13 @@ sub options_menu {
my $b_admin=button($vars{'option_w32_multi_user'});
my $b_addoneditor=button($vars{'addon_editor'});
- my $sys_bin=$vars{'sys_bin'};
- my $sys_man=$vars{'sys_man'};
- my $sys_info=$vars{'sys_info'};
+ my $sys_bin=$vars{'option_sys_bin'};
+ my $sys_man=$vars{'option_sys_man'};
+ my $sys_info=$vars{'option_sys_info'};
- my $t_sys_bin=($vars{'option_path'})? $vars{'sys_bin'}:'';
- my $t_sys_man=($vars{'option_path'})? $vars{'sys_man'}:'';
- my $t_sys_info=($vars{'option_path'})? $vars{'sys_info'}:'';
+ my $t_sys_bin=($vars{'option_path'})? $vars{'option_sys_bin'}:'';
+ my $t_sys_man=($vars{'option_path'})? $vars{'option_sys_man'}:'';
+ my $t_sys_info=($vars{'option_path'})? $vars{'option_sys_info'}:'';
my %command=(
'self' => \&options_menu,
@@ -763,24 +763,24 @@ EOF
if ($vars{'option_path'}) {
print "New value for binary directory [$sys_bin]: ";
chomp($answer=<STDIN>);
- $vars{'sys_bin'} = "$answer" if (length $answer);
- $vars{'sys_bin'} =~ s@\\@/@g if (win32());
- $vars{'sys_bin'} =~ s/^~/$home/;
- if ($vars{'sys_bin'}=~/^(.*)\/bin$/) {
- $vars{'sys_man'}="$1/man";
- $vars{'sys_info'}="$1/info";
+ $vars{'option_sys_bin'} = "$answer" if (length $answer);
+ $vars{'option_sys_bin'} =~ s@\\@/@g if (win32());
+ $vars{'option_sys_bin'} =~ s/^~/$home/;
+ if ($vars{'option_sys_bin'}=~/^(.*)\/bin$/) {
+ $vars{'option_sys_man'}="$1/man";
+ $vars{'option_sys_info'}="$1/info";
}
- print "New value for man directory [$vars{'sys_man'}]: ";
+ print "New value for man directory [$vars{'option_sys_man'}]: ";
chomp($answer=<STDIN>);
- $vars{'sys_man'}="$answer" if (length $answer);
- $vars{'sys_man'} =~ s@\\@/@g if (win32());
- $vars{'sys_man'} =~ s/^~/$home/;
+ $vars{'option_sys_man'}="$answer" if (length $answer);
+ $vars{'option_sys_man'} =~ s@\\@/@g if (win32());
+ $vars{'option_sys_man'} =~ s/^~/$home/;
- print "New value for info directory [$vars{'sys_info'}]: ";
+ print "New value for info directory [$vars{'option_sys_info'}]: ";
chomp($answer=<STDIN>);
- $vars{'sys_info'}="$answer" if (length $answer);
- $vars{'sys_info'} =~ s@\\@/@g if (win32());
- $vars{'sys_info'} =~ s/^~/$home/;
+ $vars{'option_sys_info'}="$answer" if (length $answer);
+ $vars{'option_sys_info'} =~ s@\\@/@g if (win32());
+ $vars{'option_sys_info'} =~ s/^~/$home/;
}
return $command{'self'};
}
diff --git a/Master/tlpkg/installer/install-menu-wizard.pl b/Master/tlpkg/installer/install-menu-wizard.pl
index 5048c182d6d..1c716a137de 100644
--- a/Master/tlpkg/installer/install-menu-wizard.pl
+++ b/Master/tlpkg/installer/install-menu-wizard.pl
@@ -202,7 +202,7 @@ sub ask_path {
$fmain->Label(-text => $text{'pathinfo'},
- -justify => "left")->place(-x => 0, -y => 30);
+ -justify => "left")->place(-x => 0, -y => 20);
my $ytmp = 100;
$lab->place(-x => 0, -y => $ytmp, -anchor => "w");
@@ -304,6 +304,10 @@ sub ask_options {
$_->destroy;
}
$counter->configure(-text => "3/5");
+
+ my $inf = $fmain->Label(-text => $text{"optiontitle"}, -justify => "left");
+ $inf->place(-x => 0, -y => 20);
+
my $bletter = $fmain->Checkbutton(-text => $labels{'optletter'},
-variable => \$vars{"option_letter"});
@@ -316,6 +320,9 @@ sub ask_options {
my $bpath = $fmain->Checkbutton(-text => $labels{'pathadj'},
-variable => \$vars{"option_path"});
+ my $bmulti = $fmain->Checkbutton(-text => $labels{'multiuser'},
+ -variable => \$vars{"option_w32_multi_user"});
+
calc_depends();
@@ -331,6 +338,11 @@ sub ask_options {
$ytmp += 50;
$bpath->place(-x => 0, -y => $ytmp);
+
+ if (admin()) {
+ $ytmp += 50;
+ $bmulti->place(-x => 0, -y => $ytmp);
+ }
}
$prv->configure(-text => $text{'prev'}, -command => \&ask_path );
@@ -351,7 +363,7 @@ sub ask_go {
$_->destroy;
}
$counter->configure(-text => "4/5");
- my $inf = $fmain->Label(-justify => "left", -text => $text{'readyinst'} . "\n\n" . $text{'destfolder'} . ": $dest");
+ my $inf = $fmain->Label(-justify => "left", -text => $text{'readyinst'} . "\n\n" . $text{'destfolder'} . " $dest");
$inf->place(-x => 0, -y => 100);
diff --git a/Master/tlpkg/installer/install-translations.pl b/Master/tlpkg/installer/install-translations.pl
index c75aec891e7..93331015e2f 100644
--- a/Master/tlpkg/installer/install-translations.pl
+++ b/Master/tlpkg/installer/install-translations.pl
@@ -104,6 +104,7 @@ our %text = (title => 'TeX Live 2009 Installation',
readyinst => "We are ready to install TeX Live 2009.\nThe following settings will be used.\nIf you want to change something please go back,\notherwise press the \"Install\" button.",
instshort => 'Install',
wizard => 'Go to Wizard',
+ optiontitle => 'This screen allows you to configure some options',
);
diff --git a/Master/tlpkg/installer/installer-options.txt b/Master/tlpkg/installer/installer-options.txt
index 521ff375d1c..1e8ff56b8cd 100644
--- a/Master/tlpkg/installer/installer-options.txt
+++ b/Master/tlpkg/installer/installer-options.txt
@@ -1,61 +1,79 @@
(last status change 2009-07-02)
%vars key default text perltk wizard
+ $tlpdb->option("key")
description
+ used in install-tl/tlmgr/TLMedia
----------------------------------------------------------------------------
option_doc 1 x x
+ option("install_docfiles")
install doc files
+ install-tl: sub do_install_packages
+ TLMedia.pm: sub install_package
option_src 1 x x
+ option("install_srcfiles")
install src files
+ install-tl: sub do_install_packages
+ TLMedia.pm: sub install_package
option_fmt 1 x x
+ option("create_formats")
create all formats
-
-option_letter 0 x x x
- use letter
+ install-tl: sub do_postinst_stuff
+ tlmgr: sub handle_execute_actions
option_file_assocs 0 w32 w32 w32
+ option("file_assocs")
file associations postaction
+ install-tl: sub do_tlpdb_postactions
+ TLMedia: remove_package, install_package
option_desktop_integration 0 (1 w32) w32 w32 w32
+ option("desktop_integration")
shortcuts etc
currently effects w32 only
+ install-tl: sub do_tlpdb_postactions
+ TLMedia: remove_package, install_package
option_post_code 1
+ option("post_code")
postaction code
+ install-tl: sub do_tlpdb_postactions
+ TLMedia: remove_package, install_package
+
+option_sys_bin/man/info /u/l/... unix unix
+ option("sys_bin") ...
+ unix link dests (if option_path == 1)
+ TLPDB add/remove_symlinks
+ (via tlmgr action_symlinks and install-tl do_path_adjustments)
-option_w32_multi_user 1 w32 w32 ??
+option_w32_multi_user 1 w32 w32 w32
+ option("w32_multi_user")
sysadmin as multi user
+ install-tl: sub do_path_adjustments
+ TLMedia: remove_package, install_package
+
+option_letter 0 x x x
+ not saved into the local TLPDB
+ only for install time setting
+ use letter
+ install-tl: sub do_postinst_stuff
option_path 0 x x w32??
path adjustment
+ not saved into the local TLPDB
+ only for install time setting
(unix symlinks, w32 reg)
-sys_bin/man/info /u/l/... x x
- unix link dests (if option_path == 1)
-
addon_editor 0 w32 w32 -
+ not saved into the local TLPDB
+ only for install time setting
install texworks
-w32 are things only visible on w32
-(x) are things that should be done
-?? are things I am not sure
-- are things that are not relevant
-
-Comments:
-1) in perltk mode the desktop_integration is shown for all, but on unix
- it triggers the link destination (so option_path)
-
-
-Question/Statements:
-- perltk is wrong to mix desktop_integration with path_adjustments!
- it should have separate questions
-- perltk should show desktop_integration only for w32 (as long as we
- only support actions there)
-- wizard should not ask for texworks
- done
-- wizard should ask for file_assocs, desktop_integration, path
- done
-- should the wizard ask for w32_multi_user?
+unix are things only visible on unix
+w32 are things only visible on w32
+(x) are things that should be done
+?? are things I am not sure
+- are things that are not relevant
diff --git a/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc
index 69acf2f69be..3a1862ad29e 100644
--- a/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc
+++ b/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc
@@ -8,6 +8,19 @@ longdesc 2. on an installed system it serves as a configuration file.
longdesc We have to remember these settings for additional package
longdesc installation, removal, etc.
longdesc
+longdesc There are two types here:
+longdesc - If the key starts with opt_ this is an options that can be
+longdesc set by the user either at installation time or via tlmgr later on
+longdesc - If the key starts with setting_ this value cannot be changed
+longdesc by the user directly with tlmgr, but only by other actions.
+longdesc Currently there are only two settings supported of which one
+longdesc is only used in special cases:
+longdesc . setting_available_architectures lists all available platforms
+longdesc and should be always present
+longdesc . setting_platform *overrides* the auto-deteced platform. This
+longdesc setting will only be present when you forced a sepcific
+longdesc architecture with -force-arch to install-tl
+longdesc
longdesc The value of __MASTER__ for the location field tells the
longdesc installer to use the present directory itself. For example,
longdesc the DVD can be mounted anywhere and we want the installer to work.
@@ -17,8 +30,7 @@ longdesc All packages starting with 00texlive are considered virtual packages
longdesc in the sense that no containers are generated and these packages
longdesc are never split into .src and .doc sub-packages in the tlpdb.
-depend platform:
-depend location:__MASTER__
+depend opt_location:__MASTER__
depend opt_paper:a4
depend opt_create_formats:1
depend opt_desktop_integration:0