summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-03-23 14:48:54 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-03-23 14:48:54 +0100
commitc28953f53ada2a3ba5eb0891d0bb59d28d2cef51 (patch)
tree22e4253ca4d99982d836af96f35ae44c9216c319 /src
parenta026ac6112b4a22aedc9c20a867da02afb734f56 (diff)
downloadluaotfload-c28953f53ada2a3ba5eb0891d0bb59d28d2cef51.tar.gz
[tool] add stop directive to bisect mode
Diffstat (limited to 'src')
-rwxr-xr-xsrc/luaotfload-tool.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 5c7cb1d..4c915cf 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -115,6 +115,7 @@ config.lualibs.load_extended = true
require "lualibs"
local iosavedata = io.savedata
+local lfsisdir = lfs.isdir
local lfsisfile = lfs.isfile
local stringsplit = string.split
local tableserialize = table.serialize
@@ -834,6 +835,27 @@ end
--doc]]--
local bisect_stop = function ()
+ report ("info", 3, "bisect", "Erasing bisection state at %s.", bisect_status_file)
+ if lfsisfile (bisect_status_file) then
+ local success, msg = os.remove (bisect_status_file)
+ if not success then
+ report ("info", 2, "bisect",
+ "Failed to erase file %s (%s).",
+ bisect_status_file, msg)
+ end
+ end
+ if lfsisdir (bisect_status_path) then
+ local success, msg = os.remove (bisect_status_path)
+ if not success then
+ report ("info", 2, "bisect",
+ "Failed to erase directory %s (%s).",
+ bisect_status_path, msg)
+ end
+ end
+ if lfsisfile (bisect_status_file) then
+ return false
+ end
+ return true
end
--[[doc--