| Delete' of string
| Modify' of {src : string, dst : string}
-fun shell ss = OS.Process.isSuccess (OS.Process.system (String.concat ss))
-
-fun shellF (ss, msg) =
- let
- val s = String.concat ss
- in
- if OS.Process.isSuccess (OS.Process.system s) then
- ()
- else
- ErrorMsg.error NONE (msg s)
- end
-
fun findDiffs dom =
let
val realPath = getPath dom Config.resultRoot
if Posix.FileSys.ST.isDir (Posix.FileSys.stat real) then
loopReal acts
else if Posix.FileSys.access (tmp, []) then
- if shell [Config.diff, " ", real, " ", tmp] then
+ if Slave.shell [Config.diff, " ", real, " ", tmp] then
loopReal acts
else
loopReal (Modify' {src = tmp, dst = real} :: acts)
val acts = loopReal []
- val dir = Posix.FileSys.opendir realPath
+ val dir = Posix.FileSys.opendir tmpPath
fun loopTmp acts =
case Posix.FileSys.readdir dir of
val diffs = findDiffs dom
val diffs = map (fn Add' {src, dst} =>
- (shellF ([Config.cp, " ", src, " ", dst],
+ (Slave.shellF ([Config.cp, " ", src, " ", dst],
fn cl => "Copy failed: " ^ cl);
{action = Slave.Add,
domain = dom,
domain = dom,
file = dst})
| Modify' {src, dst} =>
- (shellF ([Config.cp, " ", src, " ", dst],
+ (Slave.shellF ([Config.cp, " ", src, " ", dst],
fn cl => "Copy failed: " ^ cl);
{action = Slave.Modify,
domain = dom,
()
else
Slave.handleChanges diffs;
- ignore (shellF ([Config.rm, " -rf ", Config.tmpDir, "/*"],
+ ignore (Slave.shellF ([Config.rm, " -rf ", Config.tmpDir, "/*"],
fn cl => "Temp file cleanup failed: " ^ cl))
end)