diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 3d72e4c2b71..63f8ef44b06 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -2014,7 +2014,9 @@ sub remove_package { my $tlp = $localtlpdb->get_package($pkg); my $usertree = $localtlpdb->setting("usertree"); if (!defined($tlp)) { - tlwarn ("TLPDB: package not present, so nothing to remove: $pkg\n"); + # we should not be called. + tlwarn ("TLPDB::remove_package: package not present, ", + "so nothing to remove: $pkg\n"); } else { my $currentarch = $self->platform(); if ($pkg eq "texlive.infra" || $pkg eq "texlive.infra.$currentarch") { @@ -2025,8 +2027,10 @@ sub remove_package { my $Master = $localtlpdb->root; chdir ($Master) || die "chdir($Master) failed: $!"; my @files = $tlp->all_files; + # # also remove the .tlpobj file push @files, "tlpkg/tlpobj/$pkg.tlpobj"; + # # and the ones from src/doc splitting if (-r "tlpkg/tlpobj/$pkg.source.tlpobj") { push @files, "tlpkg/tlpobj/$pkg.source.tlpobj"; @@ -2117,20 +2121,24 @@ sub remove_package { # we have already check for the existence of the dirs returned for my $d (keys %by_dirs) { if (! &TeXLive::TLUtils::dir_writable($d)) { - tlwarn("TLPDB: directories are not writable, cannot remove files: $d\n"); + tlwarn("TLPDB::remove_package: directories are not writable, cannot remove files: $d\n"); return 0; } } # now do the removal for my $entry (@goodfiles) { - unlink $entry or tlwarn("Could not unlink $entry: $!\n"); + unlink($entry) + || $entry =~ /\.tlpobj$/ # we remove .tlpobj explicitly above + || tlwarn("TLPDB::remove_package: Could not unlink $entry: $!\n"); } for my $d (@removals) { - rmdir $d or tlwarn("Could not remove directory $d: $!\n") + rmdir($d) + || tlwarn("TLPDB::remove_package: Could not rmdir $d: $!\n") } $localtlpdb->remove_tlpobj($pkg); TeXLive::TLUtils::announce_execute_actions("disable", $tlp); + # should we save at each removal??? # advantage: the tlpdb actually reflects what is installed # disadvantage: removing a collection calls the save routine several times @@ -2149,6 +2157,7 @@ sub remove_package { # files are already removed. # Again, desktop integration maps to desktop and menu links if (!$opts{'nopostinstall'}) { + debug(" TLPDB::remove_package: running remove postinstall"); &TeXLive::TLUtils::do_postaction("remove", $tlp, $localtlpdb->option("file_assocs"), $localtlpdb->option("desktop_integration"), |