From 25cbba1ac20adca3f773955b73e62dd93efdc2b7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 10 Feb 2021 22:57:28 +0000 Subject: (uninstall_texlive): use File::Find::finddepth instead of GNU rmdir --ignore-fail-on-non-empty. Report from David Stes. git-svn-id: svn://tug.org/texlive/trunk@57705 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/tlmgr.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Master/texmf-dist/scripts/texlive') diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 7dc759544e4..44974014d29 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -93,6 +93,7 @@ BEGIN { } use Cwd qw/abs_path/; +use File::Find; use File::Spec; use Pod::Usage; use Getopt::Long qw(:config no_autoabbrev permute); @@ -5239,7 +5240,8 @@ Error message from creating MainWindow: # UNINSTALL -# +# Return zero if successful, nonzero if failure. +# sub uninstall_texlive { if (win32()) { printf STDERR "Please use \"Add/Remove Programs\" from the Control Panel to removing TeX Live!\n"; @@ -5279,13 +5281,15 @@ sub uninstall_texlive { system("rm", "-f", "$Master/$f"); } if (-d "$Master/temp") { - system("rmdir", "--ignore-fail-on-non-empty", "$Master/temp"); + finddepth(sub { rmdir; }, "$Master/temp"); } unlink("$Master/install-tl.log"); # if they want removal, give them removal. Hopefully they know how to # regenerate any changed config files. system("rm", "-rf", "$Master/texmf-config"); - system("rmdir", "--ignore-fail-on-non-empty", "$Master"); + finddepth(sub { rmdir; }, "$Master"); + + return -d "$Master"; } -- cgit v1.2.3