diff options
author | Norbert Preining <norbert@preining.info> | 2023-09-19 03:01:15 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-09-19 03:01:15 +0000 |
commit | 23c5f33b784af6cc6c4ee2f5482ef5f21c774006 (patch) | |
tree | 08d8a2ff1d038a4af70438c37ce6a36adb202fc6 /systems/texlive/tlnet/tlpkg/TeXLive | |
parent | 04fec36be1d386c1f8d5a57c3cd613d494a5c323 (diff) |
CTAN sync 202309190301
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive')
-rw-r--r-- | systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm index d19c812cfb..a0826d6036 100644 --- a/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm +++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLPDB.pm @@ -1,4 +1,4 @@ -# $Id: TLPDB.pm 68283 2023-09-15 13:11:11Z preining $ +# $Id: TLPDB.pm 68316 2023-09-18 21:15:11Z karl $ # TeXLive::TLPDB.pm - tlpdb plain text database files. # Copyright 2007-2023 Norbert Preining # This file is licensed under the GNU General Public License version 2 @@ -7,7 +7,7 @@ use strict; use warnings; package TeXLive::TLPDB; -my $svnrev = '$Revision: 68283 $'; +my $svnrev = '$Revision: 68316 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -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"), |