summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPDB.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-09-18 21:15:11 +0000
committerKarl Berry <karl@freefriends.org>2023-09-18 21:15:11 +0000
commit485ae981f02c92a9798d90b32d396c538e8ef81b (patch)
tree8925aa899a135894c568a116a6f89961596cda1b /Master/tlpkg/TeXLive/TLPDB.pm
parent64fb9a735879cbc1eb894261f88232cfdfeaa59f (diff)
(remove_package): do not warn about failing to unlink(*.tlpobj),
as we remove them explicitly. Tweak messages. git-svn-id: svn://tug.org/texlive/trunk@68316 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm17
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"),