ref: 4a7e4f29fb015d12bfab35b393aa1facbd2b763b
parent: 14d657bd447f9384130ba321324052d94a420ca1
author: Ori Bernstein <ori@markovcorp.com>
date: Wed Jan 11 08:57:22 EST 2017
Create paths for install. mbld should create paths its putting things into.
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -65,11 +65,11 @@
-> true
}
-
const movefile = {b, rm, dir, file, prefix, perm
var path
setdir(b, dir)
+ makepath(prefix)
path = std.pathjoin([opt_destdir, opt_instbase, prefix, file][:])
if rm
mbldput("\trm {}\n", path)
@@ -104,7 +104,16 @@
;;
;;
- manrel = std.fmt("{}{}", opt_manpath, man[sect:])
+ manrel = std.fmt("{}{}", config.Manpath, man[sect:])
+ makepath(manrel)
movefile(b, rm, dir, man, manrel, 0o644)
std.slfree(manrel)
+}
+
+const makepath = {prefix
+ var p
+
+ p = std.pathjoin([opt_destdir, opt_instbase, prefix][:])
+ std.mkpath(p)
+ std.slfree(p)
}
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -9,7 +9,6 @@
var opt_genasm : bool
var opt_incpaths : byte[:][:]
var opt_instbase : byte[:]
- var opt_manpath : byte[:]
var opt_destdir : byte[:]
var opt_outdir : byte[:]
var opt_debug : bool
@@ -33,7 +32,6 @@
var opt_runtime = ""
var opt_incpaths /* FIXME: taking a constant slice is a nonconstant initializer */
var opt_instbase = ""
-var opt_manpath = ""
var opt_destdir = ""
var opt_debug = false
var opt_mc = "6m"
@@ -65,7 +63,6 @@
opt_incpaths = [][:]
opt_instbase = config.Instroot
- opt_manpath = config.Manpath
opt_destdir = std.getenvv("DESTDIR", "")
opt_mc = std.getenvv("MYR_MC", "6m")
opt_muse = std.getenvv("MYR_MUSE", "muse")