diff options
author | Ori Bernstein <ori@eigenstate.org> | 2017-08-14 01:17:41 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2017-08-14 01:17:41 -0700 |
commit | bd96cb6a0a361a62871f70c07fc350bc2264b087 (patch) | |
tree | fc921e25cce50f4a6b3c74606f0fb4991361342d | |
parent | fd499b39fd02fa18c403a423e908bd39b1e8013d (diff) | |
download | mc-bd96cb6a0a361a62871f70c07fc350bc2264b087.tar.gz |
Mbld now generates directories properly.
Includes some mkdirs fixes for 9front.
-rw-r--r-- | lib/std/syswrap+plan9.myr | 2 | ||||
-rw-r--r-- | lib/std/syswrap-ss+plan9.myr | 2 | ||||
-rw-r--r-- | mbld/build.myr | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr index 6d572a9..ddf37ab 100644 --- a/lib/std/syswrap+plan9.myr +++ b/lib/std/syswrap+plan9.myr @@ -135,7 +135,7 @@ const fmtime = {path if sys.stat(path, buf[:]) < Stringsoff -> `Err Emisc ;; - -> `Ok (_getle32(buf[Mtimeoff:Mtimeoff + 8]) : time) + -> `Ok ((_getle32(buf[Mtimeoff:Mtimeoff + 8]) : time)*1_000_000) } const fsize = {path diff --git a/lib/std/syswrap-ss+plan9.myr b/lib/std/syswrap-ss+plan9.myr index 7a86564..96a2973 100644 --- a/lib/std/syswrap-ss+plan9.myr +++ b/lib/std/syswrap-ss+plan9.myr @@ -74,7 +74,7 @@ const lasterr = { err = cstrconv(errbuf[:]) if strhas(err, "no error") -> Enone - elif strhas(err, "already exists") + elif strhas(err, "already exists") || strhas(err, "is a directory") -> Eexist elif strhas(err, "read or write too large") -> Erange diff --git a/mbld/build.myr b/mbld/build.myr index ab46571..1d81c6f 100644 --- a/mbld/build.myr +++ b/mbld/build.myr @@ -71,6 +71,7 @@ const launch = {b, n var pid if stale(b, n) + mkout(n) pid = run(n.cmd, "") std.htput(b.proc, pid, n) else @@ -119,7 +120,6 @@ const unblock = {b, n std.slpush(&b.queue, g) ;; ;; - } const stale = {b, n @@ -137,7 +137,13 @@ const stale = {b, n | `std.Err e: n.mtime = 0 ;; ;; - -> staletime >= n.mtime + -> staletime > n.mtime +} + +const mkout = {n + for g : n.gen + std.mkpath(std.dirname(g)) + ;; } const fail = {b, pid, failtype |