shithub: mc

Download patch

ref: c782bfb900fdda8645f8dfe47aae345e21540633
parent: 7a08119041e6c1ac8f26f52ba7afff42ac21e631
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 2 14:03:19 EST 2016

Update code to match docs.

--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -41,12 +41,13 @@
 			;;
 		| `Data dt:
 			for blob in dt.blobs
-				if dt.base.len == 0
-					pfx = config.Sharepath
+				if dt.path.len == 0
+					pfx = std.pathcat(config.Sharepath, dt.name)
+					movefile(b, rm, dt.dir, blob, pfx, 0o644)
+					std.slfree(pfx)
 				else
-					pfx = dt.base
+					movefile(b, rm, dt.dir, blob, dt.path, 0o644)
 				;;
-				movefile(b, rm, dt.dir, blob, pfx, 0o644)
 			;;
 		| `Gen gt:
 			/* nothing to do */
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -456,7 +456,7 @@
 
 const datatarget = {b, p, targ
 	var name, attrs, blobs
-	var tags, base
+	var tags, path
 
 	match word(p)
 	| `std.Some n:	name = n
@@ -493,7 +493,7 @@
 	for elt in attrs
 		match elt
 		| ("tag", tag):		tags = std.slpush(tags, tag)
-		| ("base", basedir):	base = basedir
+		| ("path", pathdir):	path = pathdir
 		| (invalid, ""):
 			std.fatal("{}: got invalid attr '{}'\n", targ, invalid)
 		| (invalid, attr):
@@ -505,7 +505,7 @@
 		.dir=std.sldup(p.fdir),
 		.name=name,
 		.tags=tags,
-		.base=base,
+		.path=path,
 		.blobs=blobs,
 	]))
 }
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -67,7 +67,7 @@
 		dir	: byte[:]
 		name	: byte[:]
 		tags	: byte[:][:]
-		base	: byte[:]
+		path	: byte[:]
 		blobs	: byte[:][:]
 	;;