summaryrefslogtreecommitdiff
path: root/mbld/deps.myr
diff options
context:
space:
mode:
authorandrewc <andrewchamberss@gmail.com>2016-02-11 11:30:44 +1300
committerandrewc <andrewchamberss@gmail.com>2016-02-11 11:30:44 +1300
commitdd5712495a3b7a16dcc48f93c7c9017bf79b6218 (patch)
tree9f8807498528bd3a414b0d0c064dd506ccd9bd50 /mbld/deps.myr
parent5a7ad6eb2cb497076f909e54e14d42f65eb89ff9 (diff)
downloadmc-dd5712495a3b7a16dcc48f93c7c9017bf79b6218.tar.gz
stop mbld from opening a directory
Diffstat (limited to 'mbld/deps.myr')
-rw-r--r--mbld/deps.myr26
1 files changed, 20 insertions, 6 deletions
diff --git a/mbld/deps.myr b/mbld/deps.myr
index 7725a79..986078a 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -364,21 +364,35 @@ const openlib = {lib, incs
for p in incs
path = std.pathjoin([p, lib][:])
+ if !std.fisreg(path)
+ std.slfree(path)
+ continue
+ ;;
match bio.open(path, bio.Rd)
- | `std.Ok file: -> file
- | `std.Fail m: /* nothing */
+ | `std.Ok file:
+ std.slfree(path)
+ -> file
+ | `std.Fail m:
+ std.fput(std.Err, "could not open {}: {}\n", path, m)
+ goto error
;;
;;
path = std.pathjoin([opt_instbase, config.Libpath, lib][:])
match bio.open(path, bio.Rd)
- | `std.Ok file: -> file
+ | `std.Ok file:
+ std.slfree(path)
+ -> file
| `std.Fail m: /* nothing */
;;
- std.put("could not find library {} in search path:\n", lib)
+ std.fput(std.Err, "could not find library {}\n", lib)
+
+ :error
+ std.fput(std.Err, "search path is:\n")
for p in incs
- std.put("\t{}\n", p)
+ std.fput(std.Err, "\t{}\n", p)
;;
- std.fatal("\t{}\n", config.Libpath)
+ std.fput(std.Err, "\t{}\n", path)
+ std.exit(1)
}
/* pushes a dep into the dependency list */