summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-04-03 16:32:24 +0000
committerNorbert Preining <preining@logic.at>2008-04-03 16:32:24 +0000
commit9fdcebfbbb6d07ead8682e6a06d85e2911764f23 (patch)
tree5f9daf65dd2e91b2cc593ad901c6f9eeeaa6fab6
parent1cf4c485f7d21e010eda79e67384bf93158481b3 (diff)
fixes from Hans
git-svn-id: svn://tug.org/texlive/trunk@7297 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/source/texk/texlive/tlmgr22
1 files changed, 10 insertions, 12 deletions
diff --git a/Build/source/texk/texlive/tlmgr b/Build/source/texk/texlive/tlmgr
index ac31a2e677c..06fab7e6a3f 100755
--- a/Build/source/texk/texlive/tlmgr
+++ b/Build/source/texk/texlive/tlmgr
@@ -1,6 +1,6 @@
#! /usr/bin/env texlua
--*-Lua-*-
--- $Id: tlmgr.texlua 7030 2008-03-19 21:52:43Z reinhardk $
+-- $Id$
-- Copyright (C) 2008 Reinhard Kotucha, Norbert Preining.
-- You may freely use, modify and/or distribute this file.
@@ -47,7 +47,7 @@ function setupperl()
end
function findscript(scriptname)
- script = kpse.find_file(scriptname, 'texmfscripts')
+ local script = kpse.find_file(scriptname, 'texmfscripts')
if script then
return script
else
@@ -56,20 +56,18 @@ function findscript(scriptname)
end
end
-function rmdir(dirn)
+function rmdir(name)
if os.type == 'windows' then
- -- we have to replace all / with \
- foo = string.gsub(dirn, '/', '\\')
- ret = os.spawn({"rmdir", "/s", "/q", foo})
+ -- code from Hans
+ os.execute("rmdir /s /q " .. name:gsub('/', '\\'))
else
- ret = os.spawn({"rm", "-rf", dirn})
+ ret = os.spawn({"rm", "-rf", name})
end
- if ret then
- return ret
- else
- io.stderr:write(filename..': removing '..dirn.." didn't work\n")
+ local ok = lfs.attributes(name)
+ if ok then
+ io.stderr:write(string.format("%s: removing '%s' didn't succeed\n",filename,name)
end
- return ret
+ return ok
end
if string.find(arg[0], '/') then -- UNIX path