shithub: mc

Download patch

ref: 89aa864b92914c1fddcdf352ca57a97a1f06bb4b
parent: af63c8fc4082fca2b5148cb55a6870ac926660e4
author: Ori Bernstein <[email protected]>
date: Mon Jan 7 15:46:19 EST 2019

Correctly strip manpage names on Plan 9.

--- a/configure
+++ b/configure
@@ -126,6 +126,7 @@
 echo "const Sharepath = \"share\"" >> mbld/config.myr
 echo "const Binpath = \"bin\"" >> mbld/config.myr
 echo "const Libpath = \"lib/myr\"" >> mbld/config.myr
+echo "const Stripman = false" >> mbld/config.myr
 echo "const Env : (byte[:], byte[:])[:] = $env" >> mbld/config.myr
 
 
--- a/lib/crypto/bld.sub
+++ b/lib/crypto/bld.sub
@@ -15,10 +15,11 @@
 	# symmetric ciphers
 	chacha20.myr
 	aes.myr
-	aesgcm.myr
+	#aesgcm.myr
 
 	# public key ciphers
 	rsa.myr
+	x25519.myr
 
 	# randomness
 	entropy.myr	# currently assumes a /dev/random
--- a/mbld/config+plan9-x64.myr
+++ b/mbld/config+plan9-x64.myr
@@ -14,4 +14,5 @@
 	const Binpath	= "amd64/bin"
 	const Libpath	= "amd64/lib/myr"
 	const Sharepath	= "lib"
+	const Stripman	= true
 ;;
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -75,8 +75,8 @@
 			go.instdir = config.Libpath
 			gu.instdir = config.Libpath
 		;;
-		go.instmod = 0o644
-		gu.instmod = 0o644
+		go.instmode = 0o644
+		gu.instmode = 0o644
 		generates(g, gu, tu)
 		generates(g, go, to)
 
@@ -116,7 +116,7 @@
 			addnode(g, "all", go)
 			if mt.install
 				go.instdir = config.Binpath
-				go.instmod = 0o755
+				go.instmode = 0o755
 			;;
 		;;
 		std.slfree(u)
@@ -251,10 +251,14 @@
 		n = leaf(b.deps, p)
 		match std.strrfind(pg, ".")
 		| `std.None:	std.fatal("manpage {} missing section\n", pg)
-		| `std.Some i:	r = std.strcat(config.Manpath, pg[i + 1:])
+		| `std.Some i:
+			r = std.strcat(config.Manpath, pg[i + 1:])
+			if config.Stripman
+				n.instname = std.sldup(pg[:i])
+			;;
 		;;
 		n.instdir = r
-		n.instmod = 0o644
+		n.instmode = 0o644
 		addnode(b.deps, "all", n)
 	;;
 }
@@ -269,7 +273,7 @@
 		if dt.path.len == 0
 			n.instdir = config.Sharepath
 		;;
-		n.instmod = 0o644
+		n.instmode = 0o644
 		addnode(b.deps, "all", n)
 	;;
 }
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -20,7 +20,7 @@
 }
 
 const movetargs = {b, rm
-	var inst
+	var inst, name
 
 	inst = std.htgetv(b.deps.targs, "all", [][:])
 	for n : inst
@@ -28,7 +28,11 @@
 			continue
 		;;
 		for g : n.gen
-			if !movefile(b, rm, g, n.instdir, n.instmod)
+			name = n.instname
+			if name.len == 0
+				name = std.basename(g)
+			;;
+			if !movefile(b, rm, g, n.instdir, name, n.instmode)
 				-> false
 			;;
 		;;
@@ -37,11 +41,11 @@
 
 }
 
-const movefile = {b, rm, file, prefix, perm
+const movefile = {b, rm, file, prefix, instname, perm
 	var path, ok
 
 	ok = true
-	path = std.pathjoin([opt_destdir, opt_instbase, prefix, std.basename(file)][:])
+	path = std.pathjoin([opt_destdir, opt_instbase, prefix, instname][:])
 	if rm
 		mbldput("\trm {}\n", path)
 		if !std.remove(path)
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -115,7 +115,8 @@
 
 		/* install info */
 		instdir	: byte[:]
-		instmod	: int64
+		instname: byte[:]
+		instmode: int64
 
 		/* dependency names */
 		gen	: byte[:][:]