shithub: rc

ref: 45617648bc7179ec433ad4c808b0ab93246849ed
dir: /bin/mku/

View raw version
#!/bin/rc -xe
# (idiot) gottagofast update script
rfork en
extra=/sys/lib/extra

patches=(/usr/qwx/p/patch/^(\
	9fs-9paste\
	doom-autorun\
	doom-chat\
	doom-limits\
	doom-mouseglitches\
	doom-mousegrab\
	doom-naivescaleup\
	doom-nodclick\
	doom-nomousemove\
	doom-skywallhit\
	doom-spy\
	doom-udpip\
	file-mod\
	file-opus\
	ircrc-jpmfix\
	ircrc-print-log\
	man1audio-opus\
	mothra-font\
	page-del\
	page-invert\
	paint-reverse\
	play-dmid-mod\
	play-opus-aac\
	png-maxmem\
	rio-exit\
	troff-nchars\
	vgadb-w500-w520\
	acme-col\
	kbmap-col\
	libdraw-menucol\
	colors-col\
	faces-col\
	fplot-col\
	mothra-col\
	rio-col\
	samterm-col\
	spred-col\
	stats-col\
	statusmsg-col\
	statusbar-col\
	sudoku-col\
	winwatch-col\
	vt-col\
	zuke-col\
)\
	$extra/usr/sigrid/^(riow/9front.diff)\
)
more=(\
	$extra/usr/^(spew/aplay sigrid/imgtools sigrid/mp3dec)\
)
torevert=(\
	/lib/vgadb\
	/rc/bin/^(9fs ircrc play)\
	/sys/lib/kbmap\
	/sys/man/1/audio\
	/sys/src/9/pc64/mkfile\
	/sys/src/cmd/^(page.c)\
)

{
cd /
git
git/revert $torevert
sysup
. /sys/lib/rootstub
ramfs -um /mnt/b
@{cd /sys/src; tar c *} | @{cd /mnt/b; tar xT}
bind -bc /mnt/b /sys/src
for(i in $patches)
	pa4 $i
cd /sys/src
{
	mk clean
	for(i in amd64 386 arm)
		objtype=$i mk nuke
	mkall || exit NOPE
	mk clean
	cd /usr/qwx/p
	mkall
	cp -x opl2/man/1/opl2 pplay/man/1/pplay u6/man/1/u6mopl wl3d/man/1/wl3d /sys/man/1/
	cp -x wl3d/man/6/wl3d /sys/man/6/
	cd /usr/qwx/p/qk2
	for(i in amd64 386 arm)
		objtype=$i build.rc
	for(i in $more){
		if(test -d $i){
			cd $i
			mkall
		}
	}
	stealrc
	cd /
} | pump || exit 'NOPE'
cd /sys/man
mk
k9 || exit
} >>/tmp/mku.$pid
rm /tmp/mku.$pid