shithub: mc

Download patch

ref: 99bd0e314a7050f7ac4ae2c33207be08aa5c4507
parent: 21f523cc81a93d8fd88391d251bfe3ca88ffa544
author: Ori Bernstein <ori@eigenstate.org>
date: Fri May 15 21:10:15 EDT 2015

Respect {noinst} attribute.

    We used to skip the noinst attribute. Now we respect it.

--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -22,18 +22,22 @@
 	-> movetargs(b, true)
 }
 
-const movetargs = {b, delete
+const movetargs = {b, rm
 	var libarchive
 
 	for tn in b.all
 		match gettarg(b.targs, tn)
 		| `Bin bt:
-			movefile(b, delete, bt.dir, bt.name, opt_instroot, opt_destdir, config.Binpath, 0o755)
+			if bt.install
+				movefile(b, rm, bt.dir, bt.name, config.Binpath, 0o755)
+			;;
 		| `Lib lt:
-			movefile(b, delete, lt.dir, lt.name, opt_instroot, opt_destdir, config.Libpath, 0o644)
-			libarchive = std.fmt("lib%s.a", lt.name)
-			movefile(b, delete, lt.dir, libarchive, opt_instroot, opt_destdir, config.Libpath, 0o644)
-			std.slfree(libarchive)
+			if lt.install
+				movefile(b, rm, lt.dir, lt.name, config.Libpath, 0o644)
+				libarchive = std.fmt("lib%s.a", lt.name)
+				movefile(b, rm, lt.dir, libarchive, config.Libpath, 0o644)
+				std.slfree(libarchive)
+			;;
 		| `Gen gt:
 			/* nothing to do */
 		| `Cmd ct:
@@ -41,7 +45,7 @@
 		| `Man mt:
 			/* FIXME: figure out man section by number */
 			for m in mt.pages
-				moveman(b, delete, mt.dir, m)
+				moveman(b, rm, mt.dir, m)
 			;;
 		| `Test tt:	/* nothing */
 		;;
@@ -50,13 +54,13 @@
 }
 
 
-const movefile = {b, delete, dir, file, instdir, destdir, prefix, perm
+const movefile = {b, rm, dir, file, prefix, perm
 	var path
 
 	setdir(b, dir)
-	path = std.pathjoin([destdir, instdir, prefix, file][:])
-	if delete
-		std.put("\tdelete %s\n", path)
+	path = std.pathjoin([opt_destdir, opt_instroot, prefix, file][:])
+	if rm
+		std.put("\trm %s\n", path)
 		if !std.remove(path)
 			std.put("\t\tno such file %s\n", file)
 		;;
@@ -75,7 +79,7 @@
 	std.slfree(path)
 }
 
-const moveman = {b, delete, dir, man
+const moveman = {b, rm, dir, man
 	var sect, manrel
 
 	match std.strrfind(man, ".")
@@ -89,6 +93,6 @@
 	;;
 
 	manrel = std.fmt("%s%s", opt_manpath, man[sect:])
-	movefile(b, delete, dir, man, opt_instroot, opt_destdir, manrel, 0o644)
+	movefile(b, rm, dir, man, manrel, 0o644)
 	std.slfree(manrel)
 }