diff options
author | Norbert Preining <preining@logic.at> | 2008-12-26 20:18:54 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-12-26 20:18:54 +0000 |
commit | 1967755718cb27759236566a62a71ef71b8d899e (patch) | |
tree | e6b88068c8b911547001d0ce49aececca59142e3 /Master/texmf | |
parent | ce534ecf16dbca90a9e708f4e3c1f1539ef2f74f (diff) |
tlmgr2: use $tlpd->remove_symlinks in action_uninstall, and remove some
more files that have been created during installation to make uninstallation
working completely
git-svn-id: svn://tug.org/texlive/trunk@11724 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr2.pl | 160 |
1 files changed, 20 insertions, 140 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl index 32ebe5c7cd1..f68e23044bf 100755 --- a/Master/texmf/scripts/texlive/tlmgr2.pl +++ b/Master/texmf/scripts/texlive/tlmgr2.pl @@ -9,15 +9,6 @@ # - in GUI mode updating bin-texlive/texlive.infra DOES work without # the warning, but it does NOT force to restart the GUI. THAT IS BAD!!! # -# - tlmgr should support the opt_symlink option and create/remove symlinks in -# system directories when installing/removing/updating packages. -# -# currently implemented in TLPDB->add_symlinks and ->remove_symlinks -# but where to interface it here: -# . either at all update/install/remove actions automatically for -# all symlinks -# . or an additional action symlinks that does that on command -# # - 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. @@ -845,11 +836,7 @@ sub action_symlinks { } init_local_db(); if ($what =~ m/^add$/i) { - if (!$localtlpdb->option_create_symlinks) { - tlwarn("Option to create symlinks not set, please do that first!\n"); - return; - } - $localtlpdb->add_symlinks() if $localtlpdb->option_create_symlinks; + $localtlpdb->add_symlinks(); } elsif ($what =~ m/^remove$/i) { # remove symlinks $localtlpdb->remove_symlinks(); @@ -1739,14 +1726,6 @@ sub action_update { } } - # if the option for setting symlinks is called we create them - # SHOULD WE DO THAT OR ADD ANOTHER OPTION - # symlinks - # If we do it we have to add it to action_install and action_remove - # too!!! - # $localtlpdb->add_symlinks() if $localtlpdb->option_create_symlinks; - - # that already checks whether we actually have to do something close_w32_updater(); if (($nrupdated == 0) && ($tlmediasrc->media ne "NET") && $opts{"all"}) { @@ -1911,8 +1890,6 @@ sub action_option { ($localtlpdb->option_install_docfiles ? "yes": "no"), "\n"; print "Install source files (srcfiles): ", ($localtlpdb->option_install_srcfiles ? "yes": "no"), "\n"; - print "Create symlinks (symlinks): ", - ($localtlpdb->option_create_symlinks ? "yes": "no"), "\n"; print "Destination for symlinks for binaries (sys_bin): ", $localtlpdb->option_sys_bin, "\n" if $localtlpdb->option_sys_bin; @@ -1986,18 +1963,6 @@ sub action_option { print "Create formats on installation: ", $localtlpdb->option_create_formats, "\n"; } - } elsif ($what =~ m/^symlinks$/i) { - # changes the default symlinks - my $loc = shift @ARGV; - if (defined($loc)) { - print "Defaulting to", ($loc ? "" : " not"), - " create symlinks in system paths.\n"; - $localtlpdb->option_create_symlinks($loc); - $localtlpdb->save; - } else { - print "Create symlinks in system paths on installation: ", - $localtlpdb->option_create_symlinks, "\n"; - } } elsif ($what =~ m/^sys_man$/i) { # changes the default sys_man my $loc = shift @ARGV; @@ -2269,112 +2234,27 @@ sub action_uninstall { } print ("Ok, removing the whole installation:\n"); init_local_db(); - my $tlpdb = $localtlpdb; - my $opt_symlinks = 0; - my ($sys_bin,$sys_info,$sys_man); - my ($texdir,$texmflocal,$texmfhome,$texmfsysvar); - if ($tlpdb) { - $sys_bin = $tlpdb->option_sys_bin; - $sys_man = $tlpdb->option_sys_man; - $sys_info= $tlpdb->option_sys_info; - $opt_symlinks = $tlpdb->option_create_symlinks; - $texdir = $Master; - $texmfhome = `kpsewhich -var-value=TEXMFHOME`; chomp($texmfhome); - $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`; chomp($texmfsysvar); - $texmflocal = `kpsewhich -var-value=TEXMFLOCAL`; chomp($texmflocal); - } else { - die("cannot find tlpdb in $Master"); - } - # remove the links missing - if ($opt_symlinks) { - my @files; - if ((-d "$sys_bin") && (-w "$sys_bin")) { - my $plat_bindir; - if (-l "$sys_bin/pdftex") { - my $fullpath = readlink("$sys_bin/pdftex"); - if ($fullpath =~ m;^$Master/bin/(.*)/[^/]*$;) { - $plat_bindir = $1; - } - } else { - warn "$sys_bin/pdftex not present or not a link, not removing any link of binaries!\n"; - } - if ($plat_bindir) { - @files = `ls "$Master/bin/$plat_bindir"`; - chomp(@files); - foreach my $f (@files) { - next if (! -r "$sys_bin/$f"); - if ((-l "$sys_bin/$f") && - (readlink("$sys_bin/$f") =~ m;^$Master/bin/$plat_bindir/;)) { - unlink("$sys_bin/$f"); - } else { - warn ("not removing $sys_bin/$f, not a link or wrong destination!\n"); - } - } - } - `rmdir "$sys_bin" 2>/dev/null`; - } else { - warn "destination of bin symlink $sys_bin not writable, no removal of links of bin files done!\n"; - } - # info files - if (-w $sys_info) { - @files = `ls "$Master/texmf/doc/info"`; - chomp(@files); - foreach my $f (@files) { - next if (! -r "$sys_info/$f"); - if ((-l "$sys_info/$f") && - (readlink("$sys_info/$f") =~ m;^$Master/texmf/doc/info/;)) { - unlink("$sys_info/$f"); - } else { - warn ("not removing $sys_info/$f, not a link or wrong destination!\n"); - } - } - `rmdir "$sys_info" 2>/dev/null`; - } else { - warn "destination of info symlink $sys_info not writable, no removal of links of info files done!\n"; - } - # man files - if (-w $sys_man) { - my $foo = `(cd "$Master/texmf/doc/man" && echo *)`; - my @mans = split ' ', $foo; - chomp(@mans); - foreach my $m (@mans) { - my $mandir = "$Master/texmf/doc/man/$m"; - next unless -d $mandir; - next unless -d "$sys_man/$m"; - @files = `ls "$mandir"`; - chomp(@files); - foreach my $f (@files) { - next if (! -r "$sys_man/$m/$f"); - if ((-l "$sys_man/$m/$f") && - (readlink("$sys_man/$m/$f") =~ m;^$Master/texmf/doc/man/$m/;)) { - unlink("$sys_man/$m/$f"); - } else { - warn ("not removing $sys_man/$m/$f, not a link or wrong destination!\n"); - } - } - # ignore errors, it might be not empty - `rmdir "$sys_man/$m" 2>/dev/null`; - } - `rmdir "$sys_man" 2>/dev/null`; - } else { - warn "destination of man symlink $sys_man not writable, no removal of links of man files done!\n"; - } - } - # + $localtlpdb->remove_symlinks; # now do remove the rest - system("rm", "-rf", "$texdir/texmf-dist"); - system("rm", "-rf", "$texdir/texmf-doc"); - system("rm", "-rf", "$texdir/texmf-var"); - system("rm", "-rf", "$texdir/texmf"); - system("rm", "-rf", "$texdir/tlpkg"); - system("rm", "-rf", "$texdir/bin"); - if (-d "$texdir/temp") { - system("rmdir", "--ignore-fail-on-non-empty", "$texdir/temp"); - } - unlink("$texdir/install-tl.log"); + system("rm", "-rf", "$Master/texmf-dist"); + system("rm", "-rf", "$Master/texmf-doc"); + system("rm", "-rf", "$Master/texmf-var"); + system("rm", "-rf", "$Master/texmf"); + system("rm", "-rf", "$Master/tlpkg"); + system("rm", "-rf", "$Master/bin"); + system("rm", "-rf", "$Master/readme-html.dir"); + system("rm", "-rf", "$Master/readme-txt.dir"); + for my $f (qw/doc.html index.html LICENSE.CTAN LICENSE.TL README + README.usergroups release-texlive.txt texmf.cnf/) { + system("rm", "-f", $f); + } + if (-d "$Master/temp") { + system("rmdir", "--ignore-fail-on-non-empty", "$Master/temp"); + } + unlink("$Master/install-tl.log"); # should we do that???? - system("rm", "-rf", "$texdir/texmf-config"); - system("rmdir", "--ignore-fail-on-non-empty", "$texdir"); + system("rm", "-rf", "$Master/texmf-config"); + system("rmdir", "--ignore-fail-on-non-empty", "$Master"); } |