shithub: purgatorio

Download patch

ref: dd16eef8365cb0b9e4805c23291aadcaa596dd87
parent: e59ffed426f628794d4669f152eff9a6239b99db
author: henesy <devnull@localhost>
date: Thu Oct 3 01:01:40 EDT 2019

stop tracking .dis files in /dis ;; fix makestubs(1) ;; remove powerman's /opt as it requires too much modification to integrate nicely, this was broken completely previously ;; add games/bf from pete elmore ;; update /lib/emptydirs

ape/diff: b/appl/cmd/games/null: No such file or directory ape/diff: a/dis/alphabet/abc/null: No such file or directory ape/diff: a/dis/alphabet/fs/null: No such file or directory ape/diff: a/dis/alphabet/grid/null: No such file or directory ape/diff: a/dis/alphabet/main/null: No such file or directory ape/diff: a/dis/alphabet/null: No such file or directory ape/diff: a/dis/dbm/null: No such file or directory ape/diff: a/dis/ip/nppp/null: No such file or directory ape/diff: a/dis/palm/null: No such file or directory ape/diff: a/opt/misc/appl/null: No such file or directory ape/diff: a/opt/misc/dis/null: No such file or directory ape/diff: a/opt/misc/null: No such file or directory ape/diff: a/opt/mkfiles/null: No such file or directory ape/diff: a/opt/setup/null: No such file or directory ape/diff: a/opt/skel/appl/cmd/t/null: No such file or directory ape/diff: a/opt/skel/appl/cmd/null: No such file or directory ape/diff: a/opt/skel/appl/lib/t/null: No such file or directory ape/diff: a/opt/skel/appl/lib/null: No such file or directory ape/diff: a/opt/skel/appl/null: No such file or directory ape/diff: a/opt/skel/dis/cmd/null: No such file or directory ape/diff: a/opt/skel/dis/lib/null: No such file or directory ape/diff: a/opt/skel/dis/null: No such file or directory ape/diff: a/opt/skel/doc/1/null: No such file or directory ape/diff: a/opt/skel/doc/2/null: No such file or directory ape/diff: a/opt/skel/doc/null: No such file or directory ape/diff: a/opt/skel/man/1/null: No such file or directory ape/diff: a/opt/skel/man/2/null: No such file or directory ape/diff: a/opt/skel/man/null: No such file or directory ape/diff: a/opt/skel/module/null: No such file or directory ape/diff: a/opt/skel/null: No such file or directory ape/diff: a/opt/null: No such file or directory
--- a/.hgignore	Fri Sep 27 23:44:24 2019
+++ b/.hgignore	Thu Oct  3 01:01:40 2019
@@ -55,6 +55,8 @@
 tmp/*
 
 syntax: regexp
+^dis/.*.dis
+^dis/*/.*.dis
 ^appl/.*.dis
 ^appl/.*.sbl
 ^tmp/.*
--- /dev/null	Thu Aug 19 14:51:23 2021
+++ b/appl/cmd/games/bf.b	Thu Oct  3 01:01:40 2019
@@ -0,0 +1,265 @@
+# Interpreter for the canonical esoteric language.
+# Compiles to bytecode, minimal optimizations, done for fun.
+# Pete Elmore (pete at debu dot gs), New Year's Day 2014
+# Released into the public domain.
+
+implement Bf;
+
+include "sys.m"; sys: Sys;
+include "draw.m";
+include "arg.m";
+
+Bf: module {
+	init: fn(nil: ref Draw->Context, args: list of string);
+	ARENASZ: con 1024 * 1024;
+	EXIT, ADD, JZ, JNZ, ADDP, READ, WRITE: con iota;
+};
+
+init(nil: ref Draw->Context, args: list of string)
+{
+	sys = load Sys Sys->PATH;
+	arg := load Arg Arg->PATH;
+
+	arg->init(args);
+	arg->setusage("games/bf [-d|-c] [program.bf|-e inline-program]");
+
+	eflag := 0;
+	outputmode := 0;
+	source := "";
+	while ((opt := arg->opt()) != 0) {
+		case opt {
+		'e' =>
+			eflag = 1;
+			source = arg->arg();
+		'd' =>
+			outputmode = 1;
+		'c' =>
+			outputmode = 2;
+		* =>
+			arg->usage();
+		}
+	}
+	args = arg->argv();
+	if(!eflag) {
+		if(len args != 1)
+			arg->usage();
+		else
+			source = readfile(hd args);
+	}
+
+	code := compile(source);
+	case outputmode {
+	0 => execute(code, array[ARENASZ] of { * => byte 0 });
+	1 => sys->print("%s", disassemble(code));
+	2 => sys->print("%s", bf2limbo(code));
+	}
+}
+
+compile(p: string): array of int
+{
+	marks: list of int = nil;
+	code := array[len p * 2 + 1] of { * => EXIT };
+	pc := 0;
+	n: int;
+	for(i := 0; i < len p; i++) {
+		case p[i] {
+		'-' or '+' =>
+			n = 0;
+			while(i < len p) {
+				if(p[i] == '-')
+					n--;
+				else if(p[i] == '+')
+					n++;
+				else {
+					i--;
+					break;
+				}
+				i++;
+			}
+			if(n) {
+				code[pc++] = ADD;
+				code[pc++] = n;
+			}
+		'<' or '>' =>
+			n = 0;
+			while(i < len p) {
+				if(p[i] == '<')
+					n--;
+				else if(p[i] == '>')
+					n++;
+				else {
+					i--;
+					break;
+				}
+				i++;
+			}
+			if(n) {
+				code[pc++] = ADDP;
+				code[pc++] = n;
+			}
+		',' => code[pc++] = READ;
+		'.' => code[pc++] = WRITE;
+		'[' =>
+			code[pc++] = JZ;
+			marks = pc++ :: marks;
+		']' =>
+			if(marks == nil) {
+				sys->fprint(sys->fildes(2), "bf: unmatched ']' at character %d.", pc);
+				raise "fail:errors";
+			}
+			c := hd marks;
+			marks = tl marks;
+			code[pc++] = JNZ;
+			code[c] = pc;
+			code[pc++] = c;
+		}
+	}
+	if(marks != nil) {
+		sys->fprint(sys->fildes(2), "bf: unmatched '['.");
+		raise "fail:errors";
+	}
+	return code[:pc + 1];
+}
+
+execute(code: array of int, arena: array of byte)
+{
+	pc := 0;
+	p := 0;
+	buf := array[1] of byte;
+	stopreading := 0;
+	for(;;) {
+		case code[pc] {
+		ADD =>
+			arena[p] += byte code[++pc];
+		ADDP =>
+			p += code[++pc];
+			while(p < 0)
+				p += len arena;
+			p = p % len arena;
+		READ =>
+			arena[p] = byte -1;
+			if(!stopreading) {
+				n := sys->read(sys->fildes(0), buf, 1);
+				if(n < 1)
+					stopreading = 1;
+				else
+					arena[p] = buf[0];
+			}
+		WRITE =>
+			buf[0] = arena[p];
+			sys->write(sys->fildes(1), buf, 1);
+		JNZ =>
+			if(arena[p] != byte 0)
+				pc = code[pc + 1];
+			else
+				pc++;
+		JZ =>
+			if(arena[p] == byte 0)
+				pc = code[pc + 1];
+			else
+				pc++;
+		EXIT => return;
+		}
+		pc++;
+	}
+}
+
+disassemble(code: array of int): string
+{
+	s := "";
+	for(i := 0; i < len code && code[i] != EXIT; i++) {
+		s += sys->sprint("[0x%08x]  0x%02x  ", i, code[i]);
+		case code[i] {
+		ADD => s += sys->sprint("add   %d", code[++i]);
+		ADDP => s += sys->sprint("addp  %d", code[++i]);
+		READ => s += "read ";
+		WRITE => s += "write";
+		JNZ => s += sys->sprint("jnz   0x%08x", code[++i]);
+		JZ => s += sys->sprint("jz    0x%08x", code[++i]);
+		* => s += sys->sprint(">>>>>>BUG %d / 0x%08x", code[i], code[i]);
+		}
+		s += "\n";
+	}
+	return s;
+}
+
+bf2limbo(code: array of int): string
+{
+	indent := 1;
+	s := "implement BfProg;\n" +
+		"include \"sys.m\"; sys: Sys;\n" +
+		"include \"draw.m\";\n" +
+		"BfProg: module {\n" +
+		"\tinit: fn(nil: ref Draw->Context, nil: list of string);\n" +
+		"};\n" +
+		"init(nil: ref Draw->Context, nil: list of string)\n{\n" +
+		"\tsys = load Sys Sys->PATH;\n" +
+		"\tp := 0;\n" +
+		"\tstopreading := 0;\n" +
+		"\tn := 0;\n" +
+		"\tbuf := array[1] of byte;\n" +
+		"\tarena := array[" + string ARENASZ + "] of { * => byte 0 };\n" +
+		"\n";
+	for(i := 0; i < len code && code[i] != EXIT; i++) {
+		case code[i] {
+		ADD => s += indents(indent) + "arena[p] += byte " + string code[++i] + ";\n";
+		ADDP =>
+			s += indents(indent) + "p += " + string code[++i] + ";\n" +
+				indents(indent) + "while(p < 0)\n" +
+				indents(indent + 1) + "p += len arena;\n" +
+				indents(indent) + "p = p % len arena;\n";
+		READ =>
+			s += indents(indent) + "arena[p] = byte -1;\n" +
+				indents(indent) + "if(!stopreading) {\n" +
+				indents(indent + 1) + "n = sys->read(sys->fildes(0), buf, 1);\n" +
+				indents(indent + 1) + "if(n < 1)\n" +
+				indents(indent + 2) + "stopreading = 1;\n" +
+				indents(indent + 1) + "else\n" +
+				indents(indent + 2) + "arena[p] = buf[0];\n" +
+				indents(indent) + "}\n";
+		WRITE =>
+			s += indents(indent) + "buf[0] = arena[p];\n" +
+				indents(indent) + "sys->write(sys->fildes(1), buf, 1);\n";
+		JNZ =>
+			indent--;
+			s += indents(indent) + "}\n";
+			i++;
+		JZ =>
+			s += indents(indent) + "while(arena[p] != byte 0) {\n";
+			indent++;
+			i++;
+		}
+		
+	}
+	return s + "}\n";
+}
+
+indents(i: int): string
+{
+	r := "";
+	while(i > 0) {
+		r += "\t";
+		i--;
+	}
+	return r;
+}
+
+readfile(fname: string): string
+{
+	fd := sys->open(fname, Sys->OREAD);
+	if(fd == nil)
+		die(fname);
+
+	src := "";
+	buf := array[Sys->ATOMICIO] of byte;
+	while((n := sys->read(fd, buf, len buf)) > 0) {
+		src += string buf[:n];
+	}
+	return src;
+}
+
+die(s: string)
+{
+	sys->fprint(sys->fildes(2), "bf: %s: %r\n", s);
+	raise "fail:errors";
+}
--- /dev/null	Thu Aug 19 14:51:23 2021
+++ b/appl/cmd/games/mkfile	Thu Oct  3 01:01:40 2019
@@ -0,0 +1,13 @@
+<../../../mkconfig
+
+TARG=\
+	bf.dis\
+
+SYSMODULES=\
+	arg.m\
+	sys.m\
+	draw.m\
+
+DISBIN=$ROOT/dis/games
+
+<$ROOT/mkfiles/mkdis
--- a/appl/cmd/mkfile	Fri Sep 27 23:44:24 2019
+++ b/appl/cmd/mkfile	Thu Oct  3 01:01:40 2019
@@ -6,6 +6,7 @@
 	avr\
 	disk\
 	fs\
+	games\
 	install\
 	ip\
 	lego\
@@ -74,7 +75,7 @@
 	ftpfs.dis\
 	getauthinfo.dis\
 	gettar.dis\
-	# gif2bit.dis\
+	gif2bit.dis\
 	grep.dis\
 	gunzip.dis\
 	gzip.dis\
Binary files a/dis/acme/guiwm.dis and /dev/null differ
Binary files a/dis/alphabet/abc.dis and /dev/null differ
Binary files a/dis/alphabet/abc/abc.dis and /dev/null differ
Binary files a/dis/alphabet/abc/autoconvert.dis and /dev/null differ
Binary files a/dis/alphabet/abc/autodeclare.dis and /dev/null differ
Binary files a/dis/alphabet/abc/declare.dis and /dev/null differ
Binary files a/dis/alphabet/abc/declares.dis and /dev/null differ
Binary files a/dis/alphabet/abc/define.dis and /dev/null differ
Binary files a/dis/alphabet/abc/eval.dis and /dev/null differ
Binary files a/dis/alphabet/abc/import.dis and /dev/null differ
Binary files a/dis/alphabet/abc/rewrite.dis and /dev/null differ
Binary files a/dis/alphabet/abc/type.dis and /dev/null differ
Binary files a/dis/alphabet/abc/typeset.dis and /dev/null differ
Binary files a/dis/alphabet/abc/undeclare.dis and /dev/null differ
Binary files a/dis/alphabet/abctypes.dis and /dev/null differ
Binary files a/dis/alphabet/alphabet.dis and /dev/null differ
Binary files a/dis/alphabet/alphabet.shmod.dis and /dev/null differ
Binary files a/dis/alphabet/endpoints.dis and /dev/null differ
Binary files a/dis/alphabet/endpointsrv.dis and /dev/null differ
Binary files a/dis/alphabet/eval.dis and /dev/null differ
Binary files a/dis/alphabet/extvalues.dis and /dev/null differ
Binary files a/dis/alphabet/fs.dis and /dev/null differ
Binary files a/dis/alphabet/fs/and.dis and /dev/null differ
Binary files a/dis/alphabet/fs/bundle.dis and /dev/null differ
Binary files a/dis/alphabet/fs/chstat.dis and /dev/null differ
Binary files a/dis/alphabet/fs/compose.dis and /dev/null differ
Binary files a/dis/alphabet/fs/depth.dis and /dev/null differ
Binary files a/dis/alphabet/fs/entries.dis and /dev/null differ
Binary files a/dis/alphabet/fs/exec.dis and /dev/null differ
Binary files a/dis/alphabet/fs/filter.dis and /dev/null differ
Binary files a/dis/alphabet/fs/ls.dis and /dev/null differ
Binary files a/dis/alphabet/fs/match.dis and /dev/null differ
Binary files a/dis/alphabet/fs/merge.dis and /dev/null differ
Binary files a/dis/alphabet/fs/mergewrite.dis and /dev/null differ
Binary files a/dis/alphabet/fs/mode.dis and /dev/null differ
Binary files a/dis/alphabet/fs/newer.dis and /dev/null differ
Binary files a/dis/alphabet/fs/not.dis and /dev/null differ
Binary files a/dis/alphabet/fs/or.dis and /dev/null differ
Binary files a/dis/alphabet/fs/path.dis and /dev/null differ
Binary files a/dis/alphabet/fs/pipe.dis and /dev/null differ
Binary files a/dis/alphabet/fs/print.dis and /dev/null differ
Binary files a/dis/alphabet/fs/proto.dis and /dev/null differ
Binary files a/dis/alphabet/fs/query.dis and /dev/null differ
Binary files a/dis/alphabet/fs/run.dis and /dev/null differ
Binary files a/dis/alphabet/fs/select.dis and /dev/null differ
Binary files a/dis/alphabet/fs/setroot.dis and /dev/null differ
Binary files a/dis/alphabet/fs/size.dis and /dev/null differ
Binary files a/dis/alphabet/fs/unbundle.dis and /dev/null differ
Binary files a/dis/alphabet/fs/walk.dis and /dev/null differ
Binary files a/dis/alphabet/fs/write.dis and /dev/null differ
Binary files a/dis/alphabet/fsfilter.dis and /dev/null differ
Binary files a/dis/alphabet/fstypes.dis and /dev/null differ
Binary files a/dis/alphabet/grid.dis and /dev/null differ
Binary files a/dis/alphabet/grid/farm.dis and /dev/null differ
Binary files a/dis/alphabet/grid/line2rec.dis and /dev/null differ
Binary files a/dis/alphabet/grid/local.dis and /dev/null differ
Binary files a/dis/alphabet/grid/remote.dis and /dev/null differ
Binary files a/dis/alphabet/grid/rexec.dis and /dev/null differ
Binary files a/dis/alphabet/gridtypes.dis and /dev/null differ
Binary files a/dis/alphabet/main/auth.dis and /dev/null differ
Binary files a/dis/alphabet/main/cat.dis and /dev/null differ
Binary files a/dis/alphabet/main/create.dis and /dev/null differ
Binary files a/dis/alphabet/main/dial.dis and /dev/null differ
Binary files a/dis/alphabet/main/echo.dis and /dev/null differ
Binary files a/dis/alphabet/main/env.dis and /dev/null differ
Binary files a/dis/alphabet/main/export.dis and /dev/null differ
Binary files a/dis/alphabet/main/fd.dis and /dev/null differ
Binary files a/dis/alphabet/main/filter.dis and /dev/null differ
Binary files a/dis/alphabet/main/mount.dis and /dev/null differ
Binary files a/dis/alphabet/main/par.dis and /dev/null differ
Binary files a/dis/alphabet/main/parse.dis and /dev/null differ
Binary files a/dis/alphabet/main/pretty.dis and /dev/null differ
Binary files a/dis/alphabet/main/print.dis and /dev/null differ
Binary files a/dis/alphabet/main/read.dis and /dev/null differ
Binary files a/dis/alphabet/main/readall.dis and /dev/null differ
Binary files a/dis/alphabet/main/rewrite.dis and /dev/null differ
Binary files a/dis/alphabet/main/seq.dis and /dev/null differ
Binary files a/dis/alphabet/main/unparse.dis and /dev/null differ
Binary files a/dis/alphabet/main/w2fd.dis and /dev/null differ
Binary files a/dis/alphabet/main/wait.dis and /dev/null differ
Binary files a/dis/alphabet/mktypeset.dis and /dev/null differ
Binary files a/dis/alphabet/proxy.dis and /dev/null differ
Binary files a/dis/alphabet/reports.dis and /dev/null differ
Binary files a/dis/alphabet/rexecsrv.dis and /dev/null differ
Binary files a/dis/asm.dis and /dev/null differ
Binary files a/dis/auth/infauth.dis and /dev/null differ
Binary files a/dis/auth/proto/infauth.dis and /dev/null differ
Binary files a/dis/auth/sign.dis and /dev/null differ
Binary files a/dis/auxi/camera.dis and /dev/null differ
Binary files a/dis/auxi/chatsrv.dis and /dev/null differ
Binary files a/dis/auxi/ns.dis and /dev/null differ
Binary files a/dis/auxi/odbcmnt.dis and /dev/null differ
Binary files a/dis/auxi/wbsrv.dis and /dev/null differ
Binary files a/dis/dbm/delete.dis and /dev/null differ
Binary files a/dis/dbm/fetch.dis and /dev/null differ
Binary files a/dis/dbm/keys.dis and /dev/null differ
Binary files a/dis/dbm/list.dis and /dev/null differ
Binary files a/dis/dbm/store.dis and /dev/null differ
Binary files a/dis/demo/camera/jpg2bit.dis and /dev/null differ
Binary files a/dis/demo/camera/readjpg.dis and /dev/null differ
Binary files a/dis/demo/readjpg.dis and /dev/null differ
Binary files a/dis/fs/join.dis and /dev/null differ
Binary files a/dis/fs/merge2.dis and /dev/null differ
Binary files a/dis/ip/nppp/modem.dis and /dev/null differ
Binary files a/dis/ip/nppp/ppplink.dis and /dev/null differ
Binary files a/dis/ip/nppp/script.dis and /dev/null differ
Binary files a/dis/lib/mash/tk.dis and /dev/null differ
Binary files a/dis/lib/regexutils.dis and /dev/null differ
Binary files a/dis/lib/spki/keyreps.dis and /dev/null differ
Binary files a/dis/lib/styxconv/styxconv.dis and /dev/null differ
Binary files a/dis/lib/tcl_tk.dis and /dev/null differ
--- a/dis/makestubs	Fri Sep 27 23:44:24 2019
+++ b/dis/makestubs	Thu Oct  3 01:01:40 2019
@@ -5,7 +5,7 @@
 
 user=`{cat /dev/user}
 
-dirs=(/tmp /mnt/keys /mnt/registry /mnt/acme /n/remote /chan /keydb)
+dis=`{cat /lib/emptydirs}
 
 for i in $dirs {
 	mkdir -p $i
Binary files a/dis/palm/connex.dis and /dev/null differ
Binary files a/dis/palm/desklink.dis and /dev/null differ
Binary files a/dis/palm/palmsrv.dis and /dev/null differ
Binary files a/dis/sh/alphabet.dis and /dev/null differ
Binary files a/dis/sh/mk.dis and /dev/null differ
Binary files a/dis/sh/shmk.dis and /dev/null differ
Binary files a/dis/spree/joinsession.dis and /dev/null differ
Binary files a/dis/wm/chat.dis and /dev/null differ
Binary files a/dis/wm/mpeg.dis and /dev/null differ
Binary files a/dis/wm/qt.dis and /dev/null differ
--- a/lib/emptydirs	Fri Sep 27 23:44:24 2019
+++ b/lib/emptydirs	Thu Oct  3 01:01:40 2019
@@ -90,4 +90,70 @@
 usr/inferno/tmp
 services/collab/export/services
 services/collab/export/collab
-
+dis/acme
+dis/alphabet
+dis/alphabet/abc
+dis/alphabet/fs
+dis/alphabet/grid
+dis/alphabet/main
+dis/alphabet/auth
+dis/alphabet/auth/proto
+dis/auxi
+dis/avr
+dis/charon
+dis/collab
+dis/collab/clients
+dis/collab/lib
+dis/collab/servers
+dis/db
+dis/demo
+dis/demo/camera
+dis/demo/chat
+dis/demo/cpupool
+dis/demo/lego
+dis/demo/ns
+dis/demo/odbc
+dis/demo/spree
+dis/demo/whiteboard
+dis/disk
+dis/ebook
+dis/fs
+dis/games
+dis/grid
+dis/grid/demo
+dis/grid/lib
+dis/install
+dis/ip
+dis/ip/nppp
+dis/ip/ppp
+dis/lego
+dis/lib
+dis/lib/convcs
+dis/lib/crypt
+dis/lib/encoding
+dis/lib/ftree
+dis/lib/ida
+dis/lib/mash
+dis/lib/print
+dis/lib/spki
+dis/lib/strokes
+dis/lib/styxconv
+dis/lib/usb
+dis/lib/w3c
+dis/math
+dis/mpc
+dis/mpeg
+dis/ndb
+dis/palm
+dis/sh
+dis/spki
+dis/spree
+dis/spree/clients
+dis/spree/engines
+dis/spree/lib
+dis/svc/httpd
+dis/svc/webget
+dis/tiny
+dis/usb
+dis/wm
+dis/wm/brutus
--- a/lib/sh/profile	Fri Sep 27 23:44:24 2019
+++ b/lib/sh/profile	Thu Oct  3 01:01:40 2019
@@ -16,7 +16,7 @@
 # Networking
 ndb/dns -r
 ndb/cs
-# bind -b '#scs' /net
+# bind -a '#scs' /net
 mount {mntgen} /n
 mount {mntgen} /mnt
 
--- a/mkfile	Fri Sep 27 23:44:24 2019
+++ b/mkfile	Thu Oct  3 01:01:40 2019
@@ -38,7 +38,7 @@
 
 DIRS=\
 	$EMUDIRS\
-#	appl\
+	appl\
 
 foo:QV:
 	echo mk all, clean, install, installall or nuke
--- a/opt/README	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,2 +0,0 @@
-optional components live in subdirectories of /opt.
-see opt(6) and opt(1)
--- a/opt/misc/appl/bf.b	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,269 +0,0 @@
-# Interpreter for the canonical esoteric language.
-# Compiles to bytecode, minimal optimizations, done for fun.
-# Pete Elmore (pete at debu dot gs), New Year's Day 2014
-# Released into the public domain.
-
-implement Bf;
-
-include "sys.m"; sys: Sys;
-include "draw.m";
-include "arg.m";
-
-Bf: module {
-	init: fn(nil: ref Draw->Context, args: list of string);
-	ARENASZ: con 1024 * 1024;
-	EXIT, ADD, JZ, JNZ, ADDP, READ, WRITE: con iota;
-};
-
-init(nil: ref Draw->Context, args: list of string)
-{
-	sys = load Sys Sys->PATH;
-	arg := load Arg Arg->PATH;
-
-	arg->init(args);
-	eflag := 0;
-	outputmode := 0;
-	source := "";
-	while ((opt := arg->opt()) != 0) {
-		case opt {
-		'e' =>
-			eflag = 1;
-			source = arg->arg();
-		'd' =>
-			outputmode = 1;
-		'c' =>
-			outputmode = 2;
-		* =>
-			usage();
-		}
-	}
-	args = arg->argv();
-	if(!eflag) {
-		if(len args != 1)
-			usage();
-		else
-			source = readfile(hd args);
-	}
-
-	code := compile(source);
-	case outputmode {
-	0 => execute(code, array[ARENASZ] of { * => byte 0 });
-	1 => sys->print("%s", disassemble(code));
-	2 => sys->print("%s", bf2limbo(code));
-	}
-}
-
-usage()
-{
-	sys->fprint(sys->fildes(2), "usage: bf [-d|-c] [program.bf|-e inline-program]");
-	raise "fail:usage";
-}
-
-compile(p: string): array of int
-{
-	marks: list of int = nil;
-	code := array[len p * 2 + 1] of { * => EXIT };
-	pc := 0;
-	n: int;
-	for(i := 0; i < len p; i++) {
-		case p[i] {
-		'-' or '+' =>
-			n = 0;
-			while(i < len p) {
-				if(p[i] == '-')
-					n--;
-				else if(p[i] == '+')
-					n++;
-				else {
-					i--;
-					break;
-				}
-				i++;
-			}
-			if(n) {
-				code[pc++] = ADD;
-				code[pc++] = n;
-			}
-		'<' or '>' =>
-			n = 0;
-			while(i < len p) {
-				if(p[i] == '<')
-					n--;
-				else if(p[i] == '>')
-					n++;
-				else {
-					i--;
-					break;
-				}
-				i++;
-			}
-			if(n) {
-				code[pc++] = ADDP;
-				code[pc++] = n;
-			}
-		',' => code[pc++] = READ;
-		'.' => code[pc++] = WRITE;
-		'[' =>
-			code[pc++] = JZ;
-			marks = pc++ :: marks;
-		']' =>
-			if(marks == nil) {
-				sys->fprint(sys->fildes(2), "bf: unmatched ']' at character %d.", pc);
-				raise "fail:errors";
-			}
-			c := hd marks;
-			marks = tl marks;
-			code[pc++] = JNZ;
-			code[c] = pc;
-			code[pc++] = c;
-		}
-	}
-	if(marks != nil) {
-		sys->fprint(sys->fildes(2), "bf: unmatched '['.");
-		raise "fail:errors";
-	}
-	return code[:pc + 1];
-}
-
-execute(code: array of int, arena: array of byte)
-{
-	pc := 0;
-	p := 0;
-	buf := array[1] of byte;
-	stopreading := 0;
-	for(;;) {
-		case code[pc] {
-		ADD =>
-			arena[p] += byte code[++pc];
-		ADDP =>
-			p += code[++pc];
-			while(p < 0)
-				p += len arena;
-			p = p % len arena;
-		READ =>
-			arena[p] = byte -1;
-			if(!stopreading) {
-				n := sys->read(sys->fildes(0), buf, 1);
-				if(n < 1)
-					stopreading = 1;
-				else
-					arena[p] = buf[0];
-			}
-		WRITE =>
-			buf[0] = arena[p];
-			sys->write(sys->fildes(1), buf, 1);
-		JNZ =>
-			if(arena[p] != byte 0)
-				pc = code[pc + 1];
-			else
-				pc++;
-		JZ =>
-			if(arena[p] == byte 0)
-				pc = code[pc + 1];
-			else
-				pc++;
-		EXIT => return;
-		}
-		pc++;
-	}
-}
-
-disassemble(code: array of int): string
-{
-	s := "";
-	for(i := 0; i < len code && code[i] != EXIT; i++) {
-		s += sys->sprint("[0x%08x]  0x%02x  ", i, code[i]);
-		case code[i] {
-		ADD => s += sys->sprint("add   %d", code[++i]);
-		ADDP => s += sys->sprint("addp  %d", code[++i]);
-		READ => s += "read ";
-		WRITE => s += "write";
-		JNZ => s += sys->sprint("jnz   0x%08x", code[++i]);
-		JZ => s += sys->sprint("jz    0x%08x", code[++i]);
-		* => s += sys->sprint(">>>>>>BUG %d / 0x%08x", code[i], code[i]);
-		}
-		s += "\n";
-	}
-	return s;
-}
-
-bf2limbo(code: array of int): string
-{
-	indent := 1;
-	s := "implement BfProg;\n" +
-		"include \"sys.m\"; sys: Sys;\n" +
-		"include \"draw.m\";\n" +
-		"BfProg: module {\n" +
-		"\tinit: fn(nil: ref Draw->Context, nil: list of string);\n" +
-		"};\n" +
-		"init(nil: ref Draw->Context, nil: list of string)\n{\n" +
-		"\tsys = load Sys Sys->PATH;\n" +
-		"\tp := 0;\n" +
-		"\tstopreading := 0;\n" +
-		"\tn := 0;\n" +
-		"\tbuf := array[1] of byte;\n" +
-		"\tarena := array[" + string ARENASZ + "] of { * => byte 0 };\n" +
-		"\n";
-	for(i := 0; i < len code && code[i] != EXIT; i++) {
-		case code[i] {
-		ADD => s += indents(indent) + "arena[p] += byte " + string code[++i] + ";\n";
-		ADDP =>
-			s += indents(indent) + "p += " + string code[++i] + ";\n" +
-				indents(indent) + "while(p < 0)\n" +
-				indents(indent + 1) + "p += len arena;\n" +
-				indents(indent) + "p = p % len arena;\n";
-		READ =>
-			s += indents(indent) + "arena[p] = byte -1;\n" +
-				indents(indent) + "if(!stopreading) {\n" +
-				indents(indent + 1) + "n = sys->read(sys->fildes(0), buf, 1);\n" +
-				indents(indent + 1) + "if(n < 1)\n" +
-				indents(indent + 2) + "stopreading = 1;\n" +
-				indents(indent + 1) + "else\n" +
-				indents(indent + 2) + "arena[p] = buf[0];\n" +
-				indents(indent) + "}\n";
-		WRITE =>
-			s += indents(indent) + "buf[0] = arena[p];\n" +
-				indents(indent) + "sys->write(sys->fildes(1), buf, 1);\n";
-		JNZ =>
-			indent--;
-			s += indents(indent) + "}\n";
-			i++;
-		JZ =>
-			s += indents(indent) + "while(arena[p] != byte 0) {\n";
-			indent++;
-			i++;
-		}
-		
-	}
-	return s + "}\n";
-}
-
-indents(i: int): string
-{
-	r := "";
-	while(i > 0) {
-		r += "\t";
-		i--;
-	}
-	return r;
-}
-
-readfile(fname: string): string
-{
-	fd := sys->open(fname, Sys->OREAD);
-	if(fd == nil)
-		die(fname);
-
-	src := "";
-	buf := array[Sys->ATOMICIO] of byte;
-	while((n := sys->read(fd, buf, len buf)) > 0) {
-		src += string buf[:n];
-	}
-	return src;
-}
-
-die(s: string)
-{
-	sys->fprint(sys->fildes(2), "bf: %s: %r\n", s);
-	raise "fail:errors";
-}
--- a/opt/misc/appl/hello.b	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,15 +0,0 @@
-implement Hello;
-
-include "sys.m";
-	sys: Sys;
-include "draw.m";
-
-Hello: module {
-	init:
-	fn(ctxt: ref Draw->Context, argv: list of string);
-};
-
-init(ctxt : ref Draw->Context, argv: list of string) {
-	sys = load Sys Sys->PATH;
-	sys->print("Hello World!\n");
-}
Binary files a/opt/misc/dis/bf.dis and /dev/null differ
Binary files a/opt/misc/dis/hello.dis and /dev/null differ
--- a/opt/mkfiles/README.md	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,49 +0,0 @@
-# Description
-
-These mkfiles can be used as is or as basis for your own mkfiles. Unlike
-standard files in `/mkfiles` these know how to handle `/opt` packages;
-able to build/run tests (both in host os and inside emu) and have other
-features (generation of INDEX files for your man pages, generation of man
-pages from text in asciidoc markup, etc.).
-
-
-# Install
-
-Make directory with these files available in /opt/mkfiles.
-
-Install system-wide:
-
-```
-# git clone https://github.com/powerman/inferno-opt-mkfiles.git $INFERNO_ROOT/opt/mkfiles
-```
-
-or in your home directory:
-
-```
-$ git clone https://github.com/powerman/inferno-opt-mkfiles.git $INFERNO_USER_HOME/opt/mkfiles
-$ emu
-; bind opt /opt
-```
-
-or locally for your project:
-
-```
-$ git clone https://github.com/powerman/inferno-opt-mkfiles.git $YOUR_PROJECT_DIR/opt/mkfiles
-$ emu
-; cd $YOUR_PROJECT_DIR_INSIDE_EMU
-; bind opt /opt
-```
-
-
-# Usage
-
-Start your new project using these mkfiles:
-
-```
-$ emu
-; mkdir newproject
-; cd newproject
-; cp /opt/mkfiles/mkconfig-example mkconfig
-; cp /opt/mkfiles/mkfile-example mkfile
-```
-
--- a/opt/mkfiles/mkasciidoc	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,43 +0,0 @@
-# MANDIR=$PKGDIR/man/2
-# 
-# MANTARG=\
-# 	somelib\
-# 
-
-KEEPMTIME=${OSTARG:Inferno=-x}
-KEEPMTIME=${KEEPMTIME:os=-p}
-
-all:V:			${MANTARG:%=%.man}
-
-install:V:		${MANTARG:%=$MANDIR/%}
-
-test:V:			install
-
-clean:V:
-	rm -f *.man
-
-nuke:V:			clean
-	cd $MANDIR; rm -f $MANTARG
-
-%.man:N:		%.man-$OSTARG
-
-%.man-Inferno:QV:	%.txt
-	echo 'Require asciidoc (run mk install in host os)'
-	raise 'not implemented'
-
-%.man-os:QV:		%.txt
-	if ! asciidoc 2>/dev/null; then
-	    echo 'Require asciidoc: http://www.methods.co.nz/asciidoc/'
-	    false
-	elif ! asciidoc --backend list 2>/dev/null | grep -q 9man; then
-	    echo 'Require 9man backend for asciidoc: http://powerman.name/asciidoc/'
-	    false
-	else
-	    echo asciidoc -d manpage -b 9man $stem.txt
-	    asciidoc -d manpage -b 9man $stem.txt 
-	    # avoid redundant INDEX regen on next mk all
-	    touch -c -r $stem.txt -d '+1 second' $stem.man
-	fi
-
-$MANDIR/%:		%.man
-	rm -f $MANDIR/$stem && cp $KEEPMTIME $stem.man $MANDIR/$stem
--- a/opt/mkfiles/mkconfig-example	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,26 +0,0 @@
-<$ROOT/mkconfig
-
-
-# PKGDIR: [host,emu] path to project's root (from mkfile's dir).
-# Used to run tests. Also very useful to simplify paths in any mkfile.
-PKGDIR=$PKGDIR	# MUST BE SET IN EVERY mkfile BEFORE INCLUDING THIS mkconfig!
-
-# OPTDIR: [host,emu] path to dir with opt/ subdir (from mkfile's dir).
-# Used to find modules by relative path (e.g. opt/powerman/tap/module/t.m).
-OPTDIR=${OSTARG:Inferno=/}
-OPTDIR=${OPTDIR:os=$INFERNO_HOME}
-
-# MKFILES: [host,emu] path to mkfiles/ dir (from mkfile's dir).
-# Used to find helper files needed by some mkfiles and ease including them.
-MKFILES=$OPTDIR/opt/mkfiles
-
-# EMUCMD: command to run .dis file from host os.
-# EMUPKGDIR: [emu] path to project's root (from $EMUCMD's dir).
-# Used to run tests from host os (e.g. $EMUCMD $EMUPKGDIR/appl/lib/t/smoke.dis).
-EMUCMD='emu-g sh -c "run /lib/sh/profile; \$1; shutdown -h"'
-EMUPKGDIR=/opt/YOURNAME/YOURPACKAGE
-
-
-# Default target (first target in first loaded mkfile).
-usage:QV:
-    echo mk all, install, test, clean or nuke
--- a/opt/mkfiles/mkdis	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,42 +0,0 @@
-# DISBIN=$PKGDIR/dis/lib
-# 
-# TARG=\
-# 	somelib.dis\
-# 
-# SYSMODULES=\
-# 	sys.m\
-# 
-# OPTMODULES=\
-#	opt/powerman/hashtable/module/hashtable.m\
-# 
-# MODULES=\
-# 	$PKGDIR/module/somelib.m\
-# 
-
-MODDIR=$ROOT/module
-SYS_MODULE=${SYSMODULES:%=$MODDIR/%}
-OPT_MODULE=${OPTMODULES:%=$OPTDIR/%}
-LIMBOFLAGS=-I$MODDIR -I$OPTDIR
-
-all:V:			$TARG
-
-install:V:		${TARG:%=$DISBIN/%}
-
-test:V:			install
-
-clean:V:
-	rm -f *.dis *.sbl *.s
-
-nuke:V:			clean
-	cd $DISBIN; rm -f $TARG
-
-%.dis:			$MODULES $SYS_MODULE $OPT_MODULE
-
-%.dis:			%.b
-	limbo $LIMBOFLAGS -gw $stem.b
-
-%.s:			%.b
-	limbo $LIMBOFLAGS -w -G -S $stem.b
-
-$DISBIN/%.dis:		%.dis
-	rm -f $DISBIN/$stem.dis && cp $stem.dis $DISBIN/$stem.dis
--- a/opt/mkfiles/mkfile-example	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,10 +0,0 @@
-PKGDIR=.
-<$PKGDIR/mkconfig
-
-
-DIRS=\
-	appl\
-	doc\
-	man\
-
-<$MKFILES/mksubdirs
--- a/opt/mkfiles/mkindices	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,73 +0,0 @@
-# MANDIRS=\
-# 	2\
-# 
-
-MKINDICES=$MKFILES/mkindices
-
-all:V:			indices-$OSTARG
-
-install:V:		all
-
-test:V:			install
-
-clean:V:		${MANDIRS:%=clean-%}
-
-clean-%:V:
-	rm -f $stem/INDEX
-
-nuke:V:			clean
-
-indices-Inferno:QV:
-	MKINDICESABS=`{ cleanname -d `{pwd} $"MKINDICES }
-	for j in $MANDIRS {
-		if { ftest -d $j } {
-			echo cd $j'; mk -f' $MKINDICES $MKFLAGS 'MANPAGES=… INDEX'
-			@{ pctl forkns; cd $j; mk -f $MKINDICESABS $MKFLAGS 'MANPAGES=`{ ls | grep -v ''^INDEX$'' }' INDEX }
-		} {
-			! ftest -e $j || raise $j^' not a directory'
-		}
-	}
-
-indices-os:QV:
-	MKINDICESABS=$(realpath $MKINDICES)
-	for j in $MANDIRS; do
-		if test -d $j; then
-			echo cd $j'; mk -f' $MKINDICES $MKFLAGS 'MANPAGES=… INDEX'
-			(cd $j; mk -f $MKINDICESABS $MKFLAGS "MANPAGES=$(echo $(ls | grep -v '^INDEX$'))" INDEX) || exit 1
-		else
-			test ! -e $j || { echo $j not a directory; exit 1; }
-		fi
-	done
-
-INDEX:N:		INDEX-$OSTARG
-
-INDEX-Inferno:QEV:	$MANPAGES
-	test -z $"prereq || {
-		echo 'generating INDEX'
-		# /man/*/INDEX generator by Pete Elmore
-		load regex
-		for f in $prereq {
-			ws := ${re sg '0intro' 'intro' $f}
-			h := ()
-			getlines {
-				(s n rest) := ${split ' ' $line}
-				if {~ $s .SH}	{h = $n; raise continue}
-				if {no $h}	{raise continue}
-				if {~ $h NAME}	{ws = $ws $line}	{raise break}
-			} < $f
-			ws = `{echo ${re sg '( |\\)-.*' '' $"ws} | tr A-Z a-z | tr -dc 'a-z0-9_/!~. -'}
-			for w in $ws {echo $w $f} | sort
-		} | uniq >INDEX
-	}
-
-INDEX-os:QV:		$MANPAGES
-	if test -n "$prereq"; then
-		echo 'generating INDEX'
-		perl -0777 -ne '
-			s/\A.*?^\.SH\s+NAME\s*\n(.*?)^\.SH\s.*/$1/ms;
-			s/(?:\s|\\)-.*//ms;
-			$f=$ARGV;
-			$f=~s/0intro/intro/ms;
-			print "$_ $ARGV\n" for sort map {lc} $f, /([\w\/!~.-]+)/msg;
-		' $prereq | uniq >INDEX
-	fi
--- a/opt/mkfiles/mksubdirs	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,30 +0,0 @@
-# DIRS=\
-# 	subdir1\
-# 	subdir2\
-# 
-
-all:V:			all-$SHELLTYPE
-install:V:		install-$SHELLTYPE
-test:V:			test-$SHELLTYPE
-clean:V:		clean-$SHELLTYPE
-nuke:V:			nuke-$SHELLTYPE
-
-%-rc:QV:
-	for j in $DIRS {
-		if { ftest -d $j } {
-			echo cd $j'; mk' $MKFLAGS $stem
-			@{ pctl forkns; cd $j; mk $MKFLAGS $stem }
-		} {
-			! ftest -e $j || raise $j' not a directory'
-		}
-	}
-
-%-sh:QV:
-	for j in $DIRS; do
-		if test -d $j; then
-			echo cd $j'; mk' $MKFLAGS $stem
-			(cd $j; mk $MKFLAGS $stem) || exit 1
-		else
-			test ! -e $j || { echo $j not a directory; exit 1; }
-		fi
-	done
--- a/opt/mkfiles/mktest	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,51 +0,0 @@
-# TESTS=\
-# 	smoke.dis\
-# 	sometest.dis\
-# 
-# TESTTARG=\
-# 	share.dis\
-# 
-# SYSMODULES=\
-# 	sys.m\
-# 	draw.m\
-# 
-# OPTMODULES=\
-#	opt/powerman/tap/module/t.m\
-#	opt/powerman/tap/module/tap.m\
-# 
-# MODULES=\
-# 	$PKGDIR/module/somelib.m\
-# 
-
-MODDIR=$ROOT/module
-SYS_MODULE=${SYSMODULES:%=$MODDIR/%}
-OPT_MODULE=${OPTMODULES:%=$OPTDIR/%}
-LIMBOFLAGS=-I$MODDIR -I$OPTDIR
-
-all:V:			$TESTTARG $TESTS ${TESTS:%.dis=%.t}
-
-install:V:		all
-
-test:V:			install ${TESTS:%.dis=%.test-$OSTARG}
-
-clean:V:
-	rm -f *.dis *.sbl *.s *.t
-
-nuke:V:			clean
-
-%.dis:			$MODULES $SYS_MODULE $OPT_MODULE
-
-%.dis:			%.b
-	limbo $LIMBOFLAGS -gw $stem.b
-
-%.s:			%.b
-	limbo $LIMBOFLAGS -w -G -S $stem.b
-
-%.t:			$MKFILES/runtest.sh
-	cp $MKFILES/runtest.sh $stem.t
-
-%.test-Inferno:V:
-	d=`{pwd}; cd $PKGDIR; $d/$stem.dis
-
-%.test-os:V:
-	./$stem.t
--- a/opt/mkfiles/runtest.sh	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,20 +0,0 @@
-#!/bin/bash -i
-# This script designed to be executed from host os in any way:
-#	cd /…/project;	prove -r; mk test; appl/lib/t/smoke.t
-#	cd appl/lib;	prove -r; mk test; t/smoke.t
-#	cd t;		prove -r; mk test; ./smoke.t
-# It require PKGDIR, EMUPKGDIR and EMUCMD variables set in mkfile.
-
-# When this script executed not by mk (i.e. by prove or manually) it won't
-# have variables from mkfile in environment and will need to fetch them.
-function getvar() {
-	echo -e "<mkfile\ngetvar:VQ:\n\techo \$$1" |
-		mk -f /proc/self/fd/0 getvar
-}
-
-SUBDIR=$(pwd)
-cd $(getvar PKGDIR)
-PKGDIR=$(pwd)
-DIS=$(getvar EMUPKGDIR)${SUBDIR:${#PKGDIR}}/$(dirname $0)/$(basename $0 .t).dis
-
-eval "$(getvar EMUCMD) \$DIS"
--- a/opt/setup/README.md	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,41 +0,0 @@
-# Description
-
-Scripts to setup projects installed in `/opt` (bind their commands, man
-pages, etc. to standard places).
-
-
-# Install
-
-Make directory with these scripts available in /opt/setup/.
-
-Install system-wide:
-
-```
-# git clone https://github.com/powerman/inferno-opt-setup.git $INFERNO_ROOT/opt/setup
-```
-
-or in your home directory:
-
-```
-$ git clone https://github.com/powerman/inferno-opt-setup.git $INFERNO_USER_HOME/opt/setup
-$ emu
-; bind opt /opt
-```
-
-
-# Usage
-
-Add this into `profile` file in your Inferno home dir:
-
-```
-/opt/setup/cmd
-/opt/setup/man
-```
-
-The `/opt/setup/cmd` will bind all commands provided by /opt packages into
-`/dis/`, to let you run these commands by their name, without long
-`/opt/provider/package/dis/cmd/` prefix.
-
-The `/opt/setup/man` will bind all man pages provided by /opt packages
-into `/man/*/` and union provided man indexes with `/man/*/INDEX`.
-
--- a/opt/setup/cmd	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,10 +0,0 @@
-#!/dis/sh -n
-load std
-
-for d in /opt/*/dis/* /opt/*/*/dis/* {
-	or {ftest -d $d} {raise continue}
-	n := `{basename $d}
-	and {~ $n lib} {raise continue}
-	and {~ $n cmd} {n=''}
-	bind -b $d /dis/$n
-}
--- a/opt/setup/man	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,20 +0,0 @@
-#!/dis/sh -n
-load std
-
-for d in /opt/*/man/* /opt/*/*/man/* {
-	or {ftest -d $d} {raise continue}
-	n := `{basename $d}
-	if {ftest -r $d/INDEX} {
-		f := '/chan/man-' ^ $n ^ '-INDEX'
-		or {ftest -w $f} {ramfile $f; cp /man/$n/INDEX $f}
-		echo -n "{cat $f $d/INDEX} > $f
-	}
-	bind -b $d /man/$n
-}
-
-for d in /man/[1-9]* {
-	n := `{basename $d}
-	f := '/chan/man-' ^ $n ^ '-INDEX'
-	or {ftest -r $f} {raise continue}
-	or {diff $f $d/INDEX >/dev/null} {bind $f $d/INDEX}
-}
--- a/opt/skel/README.md	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,90 +0,0 @@
-# Description
-
-This project is example, which can be used as template to start new /opt
-project for OS Inferno.
-
-
-# Install
-
-Make directory with this app/module skeleton available in /opt/skel/.
-
-Install system-wide:
-
-```
-# git clone https://github.com/powerman/inferno-opt-skel.git $INFERNO_ROOT/opt/skel
-```
-
-or in your home directory:
-
-```
-$ git clone https://github.com/powerman/inferno-opt-skel.git $INFERNO_USER_HOME/opt/skel
-$ emu
-; bind opt /opt
-```
-
-## Dependencies
-
-* https://github.com/powerman/inferno-opt-mkfiles
-* https://github.com/powerman/inferno-contrib-tap (only for tests)
-* https://github.com/powerman/inferno-contrib-logger (example dependency for
-  example command :))
-* http://asciidoc.org/ (converter from asciidoc markup to other formats)
-* https://github.com/powerman/asciidoc-9man-backend (asciidoc 9man backend
-  for converting into Inferno man pages)
-
-Actually all these dependencies are optional:
-
-* mkfiles project can be just copied to ./mkfiles/ subdir in your project
-  to avoid dependency on external project
-* tap module needed only for testing; you can use another modules, but
-  this one is cool because it allow you to run tests using `prove` command
-  in host os (standard testing tool for Perl)
-* logger is just an example dependency, nothing more
-* asciidoc needed only if you like to generate Inferno man pages from
-  simple .txt source
-
-
-# Usage
-
-Just copy `/opt/skel/` into your project's directory when you start new
-project.
-
-You can build your project using these commands both from host os and
-inside emu (except `prove`, which works only in host os):
-
-```
-mk all
-mk install
-
-mk test
-prove -r
-
-mk clean
-mk nuke
-```
-
-## Example
-
-When this project installed in `/opt/skel` and your /opt is correctly set
-(https://github.com/powerman/inferno-opt-setup) you can also:
-
-```
-$ emu
-; examplecmd
-Hello from ExampleLib->init()
-user.warn: Dec  6 05:04:40 examplecmd[158]: Hello from ExampleCmd->init()
-user.err: Dec  6 05:04:40 examplecmd[158]: Hello from ExampleCmd->init()
-; man examplecmd
-EXAMPLECMD(1)                                       EXAMPLECMD(1)
-
-NAME
-     examplecmd - Example command in /opt skeleton project
-…
-; man examplelib
-EXAMPLELIB(2)                                       EXAMPLELIB(2)
-
-NAME
-     examplelib - Example library in /opt skeleton project
-…
-```
-
--- a/opt/skel/appl/cmd/examplecmd.b	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,65 +0,0 @@
-implement ExampleCmd;
-
-include "sys.m";
-	sys: Sys;
-	sprint: import sys;
-include "draw.m";
-include "opt/powerman/logger/module/logger.m";
-	logger: Logger;
-	log, ERR, WARN, NOTICE, INFO, DEBUG: import logger;
-include "arg.m";
-include "opt/skel/module/examplelib.m";
-
-
-ExampleCmd: module
-{
-	init: fn(nil: ref Draw->Context, argv: list of string);
-};
-
-init(nil: ref Draw->Context, argv: list of string)
-{
-	sys		=  load Sys Sys->PATH;
-	logger		=  checkload(load Logger Logger->PATH, "Logger");
-	logger->init();
-	arg		:= checkload(load Arg Arg->PATH, "Arg");
-	arg->init(argv);
-	logger->progname(arg->progname());
-	examplelib	:= checkload(load ExampleLib ExampleLib->PATH, "ExampleLib");
-	examplelib->init();
-
-	arg->setusage(sprint("%s [-v]", arg->progname()));
-	while((p := arg->opt()) != 0)
-		case p {
-		'v' =>	logger->verbose++;
-		* =>	arg->usage();
-		}
-	argv = arg->argv();
-	if(len argv != 0)
-		arg->usage();
-
-	log(DEBUG,  "Hello from ExampleCmd->init()");
-	log(INFO,   "Hello from ExampleCmd->init()");
-	log(NOTICE, "Hello from ExampleCmd->init()");
-	log(WARN,   "Hello from ExampleCmd->init()");
-	log(ERR,    "Hello from ExampleCmd->init()");
-}
-
-
-###
-
-fail(s: string)
-{
-	if(logger != nil)
-		log(ERR, s);
-	else
-		sys->fprint(sys->fildes(2), "%s\n", s);
-	raise "fail:"+s;
-}
-
-checkload[T](x: T, s: string): T
-{
-	if(x == nil)
-		fail(sprint("load: %s: %r", s));
-	return x;
-}
-
--- a/opt/skel/appl/cmd/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,27 +0,0 @@
-PKGDIR=../..
-<$PKGDIR/mkconfig
-
-
-DIRS=\
-	t\
-
-<$MKFILES/mksubdirs
-
-
-DISBIN=$PKGDIR/dis/cmd
-
-TARG=\
-	examplecmd.dis\
-
-SYSMODULES=\
-	sys.m\
-	draw.m\
-	arg.m\
-
-OPTMODULES=\
-	opt/powerman/logger/module/logger.m\
-
-MODULES=\
-	$PKGDIR/module/examplelib.m\
-
-<$MKFILES/mkdis
--- a/opt/skel/appl/cmd/t/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,21 +0,0 @@
-PKGDIR=../../..
-<$PKGDIR/mkconfig
-
-
-TESTS=\
-	smoke.dis\
-
-TESTTARG=\
-
-SYSMODULES=\
-	sys.m\
-	draw.m\
-	sh.m\
-
-OPTMODULES=\
-	opt/powerman/tap/module/t.m\
-	opt/powerman/tap/module/tap.m\
-
-MODULES=\
-
-<$MKFILES/mktest
--- a/opt/skel/appl/cmd/t/smoke.b	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,13 +0,0 @@
-implement T;
-
-include "opt/powerman/tap/module/t.m";
-include "sh.m";
-
-
-test()
-{
-	plan(1);
-
-	examplecmd := load Command "/opt/skel/dis/cmd/examplecmd.dis";
-	ok(examplecmd != nil, "examplecmd loaded as Command");
-}
--- a/opt/skel/appl/cmd/t/smoke.t	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,20 +0,0 @@
-#!/bin/bash -i
-# This script designed to be executed from host os in any way:
-#	cd /…/project;	prove -r; mk test; appl/lib/t/smoke.t
-#	cd appl/lib;	prove -r; mk test; t/smoke.t
-#	cd t;		prove -r; mk test; ./smoke.t
-# It require PKGDIR, EMUPKGDIR and EMUCMD variables set in mkfile.
-
-# When this script executed not by mk (i.e. by prove or manually) it won't
-# have variables from mkfile in environment and will need to fetch them.
-function getvar() {
-	echo -e "<mkfile\ngetvar:VQ:\n\techo \$$1" |
-		mk -f /proc/self/fd/0 getvar
-}
-
-SUBDIR=$(pwd)
-cd $(getvar PKGDIR)
-PKGDIR=$(pwd)
-DIS=$(getvar EMUPKGDIR)${SUBDIR:${#PKGDIR}}/$(dirname $0)/$(basename $0 .t).dis
-
-eval "$(getvar EMUCMD) \$DIS"
--- a/opt/skel/appl/lib/examplelib.b	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,12 +0,0 @@
-implement ExampleLib;
-
-include "sys.m";
-	sys: Sys;
-include "../../module/examplelib.m";
-
-
-init()
-{
-	sys = load Sys Sys->PATH;
-	sys->print("Hello from ExampleLib->init()\n");
-}
--- a/opt/skel/appl/lib/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,24 +0,0 @@
-PKGDIR=../..
-<$PKGDIR/mkconfig
-
-
-DIRS=\
-	t\
-
-<$MKFILES/mksubdirs
-
-
-DISBIN=$PKGDIR/dis/lib
-
-TARG=\
-	examplelib.dis\
-
-SYSMODULES=\
-	sys.m\
-
-OPTMODULES=\
-
-MODULES=\
-	$PKGDIR/module/examplelib.m\
-
-<$MKFILES/mkdis
--- a/opt/skel/appl/lib/t/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,21 +0,0 @@
-PKGDIR=../../..
-<$PKGDIR/mkconfig
-
-
-TESTS=\
-	smoke.dis\
-
-TESTTARG=\
-
-SYSMODULES=\
-	sys.m\
-	draw.m\
-
-OPTMODULES=\
-	opt/powerman/tap/module/t.m\
-	opt/powerman/tap/module/tap.m\
-
-MODULES=\
-	$PKGDIR/module/examplelib.m\
-
-<$MKFILES/mktest
--- a/opt/skel/appl/lib/t/smoke.b	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,18 +0,0 @@
-implement T;
-
-include "opt/powerman/tap/module/t.m";
-include "../../../module/examplelib.m";
-	examplelib: ExampleLib;
-
-
-test()
-{
-	plan(1);
-
-	examplelib = load ExampleLib ExampleLib->PATH;
-	if(examplelib == nil)
-		bail_out(sprint("load %s: %r",ExampleLib->PATH));
-
-	{ examplelib->init(); } exception e { "*"=>catched(e); }
-	raised(nil, "init() doesn't raise");
-}
--- a/opt/skel/appl/lib/t/smoke.t	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,20 +0,0 @@
-#!/bin/bash -i
-# This script designed to be executed from host os in any way:
-#	cd /…/project;	prove -r; mk test; appl/lib/t/smoke.t
-#	cd appl/lib;	prove -r; mk test; t/smoke.t
-#	cd t;		prove -r; mk test; ./smoke.t
-# It require PKGDIR, EMUPKGDIR and EMUCMD variables set in mkfile.
-
-# When this script executed not by mk (i.e. by prove or manually) it won't
-# have variables from mkfile in environment and will need to fetch them.
-function getvar() {
-	echo -e "<mkfile\ngetvar:VQ:\n\techo \$$1" |
-		mk -f /proc/self/fd/0 getvar
-}
-
-SUBDIR=$(pwd)
-cd $(getvar PKGDIR)
-PKGDIR=$(pwd)
-DIS=$(getvar EMUPKGDIR)${SUBDIR:${#PKGDIR}}/$(dirname $0)/$(basename $0 .t).dis
-
-eval "$(getvar EMUCMD) \$DIS"
--- a/opt/skel/appl/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,9 +0,0 @@
-PKGDIR=..
-<$PKGDIR/mkconfig
-
-
-DIRS=\
-	lib\
-	cmd\
-
-<$MKFILES/mksubdirs
Binary files a/opt/skel/dis/cmd/examplecmd.dis and /dev/null differ
Binary files a/opt/skel/dis/lib/examplelib.dis and /dev/null differ
--- a/opt/skel/doc/1/examplecmd.man	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,22 +0,0 @@
-.TH EXAMPLECMD 1
-.SH NAME
-examplecmd \- Example command in /opt skeleton project
-.SH SYNOPSIS
-.EX
-examplecmd [-v]
-
-.EE
-.SH DESCRIPTION
-.PP
-This command is example how to implement commands in /opt project.
-.PP
-.B -v
-will increase log verbosity level.
-.SH SOURCE
-.PP
-.B /opt/skel/appl/cmd/examplecmd.b
-.br
-.SH SEE ALSO
-.PP
-.IR examplelib (2)
-.SH BUGS
--- a/opt/skel/doc/1/examplecmd.txt	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,34 +0,0 @@
-EXAMPLECMD(1)
-=============
-
-== NAME
-
-examplecmd - Example command in /opt skeleton project
-
-
-== SYNOPSIS
-
-----
-examplecmd [-v]
-----
-
-
-== DESCRIPTION
-
-This command is example how to implement commands in /opt project.
-
-*-v* will increase log verbosity level.
-
-
-== SOURCE
-
-`/opt/skel/appl/cmd/examplecmd.b`
-
-
-== SEE ALSO
-
-examplelib(2)
-
-
-== BUGS
-
--- a/opt/skel/doc/1/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,10 +0,0 @@
-PKGDIR=../..
-<$PKGDIR/mkconfig
-
-
-MANDIR=$PKGDIR/man/1
-
-MANTARG=\
-	examplecmd\
-
-<$MKFILES/mkasciidoc
--- a/opt/skel/doc/2/examplelib.man	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,26 +0,0 @@
-.TH EXAMPLELIB 2
-.SH NAME
-examplelib \- Example library in /opt skeleton project
-.SH SYNOPSIS
-.EX
-include "opt/skel/module/examplelib.m";
-        examplelib: ExampleLib;
-examplelib = load ExampleLib ExampleLib->PATH;
-
-init: fn();
-
-.EE
-.SH DESCRIPTION
-.PP
-This module provide example how to implement library in /opt project.
-.PP
-.B init
-will say "hi" to you.
-.SH SOURCE
-.PP
-.B /opt/skel/appl/lib/examplelib.b
-.br
-.SH SEE ALSO
-.PP
-.IR examplecmd (1)
-.SH BUGS
--- a/opt/skel/doc/2/examplelib.txt	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,38 +0,0 @@
-EXAMPLELIB(2)
-=============
-
-== NAME
-
-examplelib - Example library in /opt skeleton project
-
-
-== SYNOPSIS
-
-----
-include "opt/skel/module/examplelib.m";
-	examplelib: ExampleLib;
-examplelib = load ExampleLib ExampleLib->PATH;
-
-init: fn();
-----
-
-
-== DESCRIPTION
-
-This module provide example how to implement library in /opt project.
-
-*init* will say "hi" to you.
-
-
-== SOURCE
-
-`/opt/skel/appl/lib/examplelib.b`
-
-
-== SEE ALSO
-
-examplecmd(1)
-
-
-== BUGS
-
--- a/opt/skel/doc/2/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,10 +0,0 @@
-PKGDIR=../..
-<$PKGDIR/mkconfig
-
-
-MANDIR=$PKGDIR/man/2
-
-MANTARG=\
-	examplelib\
-
-<$MKFILES/mkasciidoc
--- a/opt/skel/doc/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,9 +0,0 @@
-PKGDIR=..
-<$PKGDIR/mkconfig
-
-
-DIRS=\
-	1\
-	2\
-
-<$MKFILES/mksubdirs
--- a/opt/skel/man/1/INDEX	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1 +0,0 @@
-examplecmd examplecmd
--- a/opt/skel/man/1/examplecmd	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,22 +0,0 @@
-.TH EXAMPLECMD 1
-.SH NAME
-examplecmd \- Example command in /opt skeleton project
-.SH SYNOPSIS
-.EX
-examplecmd [-v]
-
-.EE
-.SH DESCRIPTION
-.PP
-This command is example how to implement commands in /opt project.
-.PP
-.B -v
-will increase log verbosity level.
-.SH SOURCE
-.PP
-.B /opt/skel/appl/cmd/examplecmd.b
-.br
-.SH SEE ALSO
-.PP
-.IR examplelib (2)
-.SH BUGS
--- a/opt/skel/man/2/INDEX	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1 +0,0 @@
-examplelib examplelib
--- a/opt/skel/man/2/examplelib	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,26 +0,0 @@
-.TH EXAMPLELIB 2
-.SH NAME
-examplelib \- Example library in /opt skeleton project
-.SH SYNOPSIS
-.EX
-include "opt/skel/module/examplelib.m";
-        examplelib: ExampleLib;
-examplelib = load ExampleLib ExampleLib->PATH;
-
-init: fn();
-
-.EE
-.SH DESCRIPTION
-.PP
-This module provide example how to implement library in /opt project.
-.PP
-.B init
-will say "hi" to you.
-.SH SOURCE
-.PP
-.B /opt/skel/appl/lib/examplelib.b
-.br
-.SH SEE ALSO
-.PP
-.IR examplecmd (1)
-.SH BUGS
--- a/opt/skel/man/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,9 +0,0 @@
-PKGDIR=..
-<$PKGDIR/mkconfig
-
-
-MANDIRS=\
-	1\
-	2\
-
-<$MKFILES/mkindices
--- a/opt/skel/mkconfig	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,26 +0,0 @@
-<$ROOT/mkconfig
-
-
-# PKGDIR: [host,emu] path to project's root (from mkfile's dir).
-# Used to run tests. Also very useful to simplify paths in any mkfile.
-PKGDIR=$PKGDIR	# MUST BE SET IN EVERY mkfile BEFORE INCLUDING THIS mkconfig!
-
-# OPTDIR: [host,emu] path to dir with opt/ subdir (from mkfile's dir).
-# Used to find modules by relative path (e.g. opt/powerman/tap/module/t.m).
-OPTDIR=${OSTARG:Inferno=/}
-OPTDIR=${OPTDIR:os=$INFERNO_HOME}
-
-# MKFILES: [host,emu] path to mkfiles/ dir (from mkfile's dir).
-# Used to find helper files needed by some mkfiles and ease including them.
-MKFILES=$OPTDIR/opt/mkfiles
-
-# EMUCMD: command to run .dis file from host os.
-# EMUPKGDIR: [emu] path to project's root (from $EMUCMD's dir).
-# Used to run tests from host os (e.g. $EMUCMD $EMUPKGDIR/appl/lib/t/smoke.dis).
-EMUCMD='emu-g sh -c "run /lib/sh/profile; \$1; shutdown -h"'
-EMUPKGDIR=/opt/skel
-
-
-# Default target (first target in first loaded mkfile).
-usage:QV:
-    echo mk all, install, test, clean or nuke
--- a/opt/skel/mkfile	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,10 +0,0 @@
-PKGDIR=.
-<$PKGDIR/mkconfig
-
-
-DIRS=\
-	appl\
-	doc\
-	man\
-
-<$MKFILES/mksubdirs
--- a/opt/skel/module/examplelib.m	Fri Sep 27 23:44:24 2019
+++ /dev/null	Thu Aug 19 14:51:23 2021
@@ -1,6 +0,0 @@
-ExampleLib: module
-{
-	PATH: con "/opt/skel/dis/lib/examplelib.dis";
-
-	init: fn();
-};
--- a/usr/inferno/lib/profile	Fri Sep 27 23:44:24 2019
+++ b/usr/inferno/lib/profile	Thu Oct  3 01:01:40 2019
@@ -10,6 +10,3 @@
 ndb/cs
 ndb/dns
 
-# /opt package setup
-run /opt/setup/cmd
-run /opt/setup/man