shithub: rc

Download patch

ref: e102dfca7d34f0f4845879a13c873f18dffb281c
parent: e5748bf9fab7776924d6581f1ee3ea3d42a27254
author: qwx <qwx@sciops.net>
date: Wed Aug 10 03:12:44 EDT 2022

bindbins: just assume unionfs(1) exists and use it

--- a/bin/bindbins
+++ b/bin/bindbins
@@ -1,17 +1,7 @@
-#!/bin/rc
-if(test -d $home/p/rc)
-	bind -a $home/p/rc/bin /bin
-if(test -d $home/p/rc2)
-	bind -a $home/p/rc2/bin /bin
-if(test -d $home/p/pico)
-	touch $home/bin/rc/pico && bind $home/p/pico/pico $home/bin/rc/pico
-if(test -d $home/p/sm2/bin)
-	bind -a $home/p/sm2/bin /bin
-if(test -d $home/p/notes/bin)
-	bind -a $home/p/notes/bin /bin
-if(test -d /sys/lib/go/amd64-1.15.2/bin)
-	bind -a /sys/lib/go/amd64-1.15.2/bin /bin
+f=()
+for(i in $home/p/^(rc/bin rc2/bin pico sm2/bin notes/bin) $home/bin/^($objtype rc) /sys/lib/go/amd64-1.15.2/bin /usr/ocaml/bin)
+	if(test -e $i)
+		f=($f $i)
+unionfs -bm /bin $f /rc/bin /$objtype/bin
 if(test -f $home/p/rc/fn)
 	. $home/p/rc/fn
-if(test -d /usr/ocaml/bin)
-	bind -b /usr/ocaml/bin /bin