diff options
author | Norbert Preining <preining@logic.at> | 2009-07-06 13:24:59 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-07-06 13:24:59 +0000 |
commit | 272b12713a7c57b90afc1a79100a2fa3352b22e8 (patch) | |
tree | cf4429970df27f4a602208d4ac7d0e2e762c2105 /Master | |
parent | 21c401925b2e3b1b3073b0eaf846281b6fa5d62c (diff) |
tlmgr:
- rename "tlmgr symlink" to "tlmgr path" and make it work on Windows
- tlmgrgui now calls execute_action_gui("path", "add")
git-svn-id: svn://tug.org/texlive/trunk@14148 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 68 | ||||
-rw-r--r-- | Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl | 6 |
2 files changed, 46 insertions, 28 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 8c3896ccc6a..799aeb3855b 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -369,9 +369,8 @@ sub execute_action { action_backup(); } elsif ($action =~ m/^restore$/i) { action_restore(); - } elsif ($action =~ m/^symlinks$/i) { - action_symlinks(); - finish(0); + } elsif ($action =~ m/^path$/i) { + action_path(); } elsif ($action =~ m/^search$/i) { action_search(); finish(0); @@ -878,29 +877,41 @@ sub action_show { # SYMLINKS # -sub action_symlinks { +sub action_path { my $what = shift @ARGV; if (!defined($what) || ($what !~ m/^(add|remove)$/i)) { - tlwarn("action symlinks needs one argument, either add or remove\n"); + tlwarn("action path needs one argument, either add or remove\n"); return; } init_local_db(); if ($what =~ m/^add$/i) { - TeXLive::TLUtils::add_symlinks($localtlmedia->tlpdb->root, - $localtlmedia->platform(), - $localtlmedia->tlpdb->option("sys_bin"), - $localtlmedia->tlpdb->option("sys_man"), - $localtlmedia->tlpdb->option("sys_info")); + if (win32()) { + TeXLive::TLUtils::w32_add_to_path( + $localtlmedia->location . "/bin/win32", + $localtlmedia->tlpdb->option("w32_multi_user")); + } else { + TeXLive::TLUtils::add_symlinks($localtlmedia->tlpdb->root, + $localtlmedia->platform(), + $localtlmedia->tlpdb->option("sys_bin"), + $localtlmedia->tlpdb->option("sys_man"), + $localtlmedia->tlpdb->option("sys_info")); + } } elsif ($what =~ m/^remove$/i) { - # remove symlinks - TeXLive::TLUtils::remove_symlinks($localtlmedia->tlpdb->root, - $localtlmedia->platform(), - $localtlmedia->tlpdb->option("sys_bin"), - $localtlmedia->tlpdb->option("sys_man"), - $localtlmedia->tlpdb->option("sys_info")); + if (win32()) { + TeXLive::TLUtils::w32_remove_from_path( + $localtlmedia->location . "/bin/win32", + $localtlmedia->tlpdb->option("w32_multi_user")); + } else { + # remove symlinks + TeXLive::TLUtils::remove_symlinks($localtlmedia->tlpdb->root, + $localtlmedia->platform(), + $localtlmedia->tlpdb->option("sys_bin"), + $localtlmedia->tlpdb->option("sys_man"), + $localtlmedia->tlpdb->option("sys_info")); + } } else { # that should not happen - tlwarn("that should not happen, action_symlinks what=$what\n"); + tlwarn("that should not happen, action_path what=$what\n"); exit 1; } return; @@ -2312,7 +2323,11 @@ sub action_uninstall { } print ("Ok, removing the whole installation:\n"); init_local_db(); - $localtlmedia->remove_symlinks; + TeXLive::TLUtils::remove_symlinks($localtlmedia->tlpdb->root, + $localtlmedia->platform(), + $localtlmedia->tlpdb->option("sys_bin"), + $localtlmedia->tlpdb->option("sys_man"), + $localtlmedia->tlpdb->option("sys_info")); # now do remove the rest system("rm", "-rf", "$Master/texmf-dist"); system("rm", "-rf", "$Master/texmf-doc"); @@ -2346,7 +2361,6 @@ sub action_recreate_tlpdb { my @deps; push @deps, "location:$TeXLive::TLConfig::TeXLiveURL"; push @deps, "opt_create_formats:0"; - push @deps, "opt_create_symlinks:0"; push @deps, "opt_sys_bin:/usr/local/bin"; push @deps, "opt_sys_info:/usr/local/info"; push @deps, "opt_sys_man:/usr/local/man"; @@ -3480,9 +3494,9 @@ the definitive list): 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) + sys_bin (location where binaries are linked to by action path) + sys_man (location where man pages are linked to by action path) + sys_info (location where info pages are linked to by action path) 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 @@ -3516,10 +3530,14 @@ C<--> stops parsing for arguments at the point where it appears; this is a general feature of option parsing.) -=head2 symlinks [add|remove] +=head2 path [add|remove] + +On unix adds or removes symlinks for binaries, man pages, and info pages +in the directories specified by the respective options (see above). -Adds or removes symlinks for binaries, man pages, and info pages in the -directories specified by the respective options (see above). +On W32 based systems it adds or removes the binary dir to the system or +user registry path entry, depending on being admin and the setting +$tlpdb->option("w32_multi_user"). =head2 paper diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl index e4a4062257b..63f65a7dbdf 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl @@ -239,7 +239,7 @@ if (!win32()) { -command => sub { $mw->Busy(-recurse => 1); info("Updating symlinks ...\n"); - $localtlmedia->add_symlinks(); + execute_action_gui("path", "add"); $mw->Unbusy; })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m"); @@ -247,8 +247,8 @@ if (!win32()) { $back_config_act->Button(-text => ___"removesymlinks", -command => sub { $mw->Busy(-recurse => 1); - info("Updating symlinks ...\n"); - $localtlmedia->remove_symlinks(); + info("Removing symlinks ...\n"); + execute_action_gui("path", "remove"); $mw->Unbusy; })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m"); |