diff options
author | Norbert Preining <preining@logic.at> | 2008-04-18 05:29:05 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-04-18 05:29:05 +0000 |
commit | 1563f1bb7d25dfaf1686d191ab35cac8166d677d (patch) | |
tree | 7931dde2d55eae6d4902d17d4718a5532fdb0397 /Master | |
parent | 9c9538c37ddda414073bfb73bbd6f5289b08bd18 (diff) |
use rmtree instead of rmdir
git-svn-id: svn://tug.org/texlive/trunk@7482 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.texlua | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.texlua b/Master/texmf/scripts/texlive/tlmgr.texlua index 7b6f581012b..bbb5395e184 100755 --- a/Master/texmf/scripts/texlive/tlmgr.texlua +++ b/Master/texmf/scripts/texlive/tlmgr.texlua @@ -59,16 +59,19 @@ end -- function from Reinhard, could replace rmdir, needs testing function rmtree (path) - for file in lfs.dir(path) do - if file ~= '.' and file ~= '..' then - local f = path..'/'..file - if lfs.isdir(f) then - rmtree(f) - print ('lfs.rmdir '..f) -- lfs.rmdir(f) - else - print ('os.remove '..f) -- os.remove(f) + if lfs.isdir(path) then + for file in lfs.dir(path) do + if file ~= '.' and file ~= '..' then + local f = path..'/'..file + if lfs.isdir(f) then + rmtree(f) + lfs.rmdir(f) + else + os.remove(f) + end end end + lfs.rmdir(path) end end @@ -137,15 +140,15 @@ if arg[1] == 'uninstall' then -- on unix we have removed the symlinks in case they were present -- -- now we have to remove all the files and directories - rmdir(TEXDIR.."/texmf-dist") - rmdir(TEXDIR.."/texmf-doc") - rmdir(TEXDIR.."/texmf-var") - rmdir(TEXDIR.."/texmf-config") - rmdir(TEXDIR.."/texmf") - rmdir(TEXDIR.."/tlpkg") + rmtree(TEXDIR.."/texmf-dist") + rmtree(TEXDIR.."/texmf-doc") + rmtree(TEXDIR.."/texmf-var") + rmtree(TEXDIR.."/texmf-config") + rmtree(TEXDIR.."/texmf") + rmtree(TEXDIR.."/tlpkg") os.remove(TEXDIR.."/temp") os.remove(TEXDIR.."/install-tl.log") - rmdir(TEXDIR.."/bin") + rmtree(TEXDIR.."/bin") -- now everything should be removed, try to remove also TEXDIR -- this will not succeed on win32 since texlua.exe is still in use -- and thus removing TEXDIR/bin will not work. Damned. |