HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Slaves and Exim
[hcoop/domtool2.git]
/
src
/
domain.sml
diff --git
a/src/domain.sml
b/src/domain.sml
index
394bf80
..
534e440
100644
(file)
--- a/
src/domain.sml
+++ b/
src/domain.sml
@@
-103,18
+103,6
@@
datatype file_action' =
| Delete' of string
| Modify' of {src : string, dst : string}
| 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
fun findDiffs dom =
let
val realPath = getPath dom Config.resultRoot
@@
-136,7
+124,7
@@
fun findDiffs dom =
if Posix.FileSys.ST.isDir (Posix.FileSys.stat real) then
loopReal acts
else if Posix.FileSys.access (tmp, []) then
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)
loopReal acts
else
loopReal (Modify' {src = tmp, dst = real} :: acts)
@@
-146,7
+134,7
@@
fun findDiffs dom =
val acts = loopReal []
val acts = loopReal []
- val dir = Posix.FileSys.opendir
real
Path
+ val dir = Posix.FileSys.opendir
tmp
Path
fun loopTmp acts =
case Posix.FileSys.readdir dir of
fun loopTmp acts =
case Posix.FileSys.readdir dir of
@@
-190,7
+178,7
@@
val _ = Env.container_one "domain"
val diffs = findDiffs dom
val diffs = map (fn Add' {src, dst} =>
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,
fn cl => "Copy failed: " ^ cl);
{action = Slave.Add,
domain = dom,
@@
-203,7
+191,7
@@
val _ = Env.container_one "domain"
domain = dom,
file = dst})
| Modify' {src, dst} =>
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,
fn cl => "Copy failed: " ^ cl);
{action = Slave.Modify,
domain = dom,
@@
-213,7
+201,7
@@
val _ = Env.container_one "domain"
()
else
Slave.handleChanges diffs;
()
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)
fn cl => "Temp file cleanup failed: " ^ cl))
end)