11 |
type policyMaker = { arch: string, os: SMLofNJ.SysInfo.os_kind } -> policy |
type policyMaker = { arch: string, os: SMLofNJ.SysInfo.os_kind } -> policy |
12 |
|
|
13 |
val colocate : policyMaker |
val colocate : policyMaker |
14 |
val separate : |
val separate : AbsPath.t -> policyMaker |
|
{ root: AbsPath.t, parentArc: string, absArc: string } -> policyMaker |
|
15 |
|
|
16 |
val mkBinPath : policy -> AbsPath.t -> AbsPath.t |
val mkBinPath : policy -> AbsPath.t -> AbsPath.t |
17 |
val mkSkelPath : policy -> AbsPath.t -> AbsPath.t |
val mkSkelPath : policy -> AbsPath.t -> AbsPath.t |
46 |
{ skel = cmpath skeldir, bin = archosdep, stable = archosdep } |
{ skel = cmpath skeldir, bin = archosdep, stable = archosdep } |
47 |
end |
end |
48 |
|
|
49 |
val colocate = mkPolicy (fn s => s) |
val colocate = mkPolicy (fn p => p) |
50 |
|
|
51 |
fun separate { root, parentArc, absArc } = let |
fun separate root = let |
52 |
val root = AbsPath.relativeContext root |
val root = AbsPath.relativeContext root |
53 |
fun shift p = let |
fun shift p = |
54 |
val s = AbsPath.name p |
case AbsPath.reAnchor (p, root) of |
55 |
fun cvt arc = if arc = OS.Path.parentArc then parentArc else arc |
SOME p' => p' |
56 |
in |
| NONE => (Say.say ["Failure: ", AbsPath.name p, |
57 |
case OS.Path.fromString s of |
" is not an anchored path!\n"]; |
58 |
{ isAbs = false, vol = "", arcs } => |
raise Fail "bad path") |
|
AbsPath.native { context = root, |
|
|
spec = OS.Path.toString |
|
|
{ isAbs = false, vol = "", |
|
|
arcs = map cvt arcs } } |
|
|
| _ => AbsPath.native |
|
|
{ context = root, |
|
|
spec = OS.Path.joinDirFile { dir = absArc, |
|
|
file = AbsPath.file p } } |
|
|
end |
|
59 |
in |
in |
60 |
mkPolicy shift |
mkPolicy shift |
61 |
end |
end |