From 272b12713a7c57b90afc1a79100a2fa3352b22e8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 6 Jul 2009 13:24:59 +0000 Subject: 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 --- Master/texmf/scripts/texlive/tlmgr.pl | 68 ++++++++++++++-------- .../texmf/scripts/texlive/tlmgrgui/gui-config.pl | 6 +- 2 files changed, 46 insertions(+), 28 deletions(-) (limited to 'Master') 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