ref: 556618eb07d1ac6e2c629a60acd53c45d53261be
parent: e182ec11fb0b4e90d69f94dc5020deed505bf33a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Sep 16 20:36:51 EDT 2023
sysupdate: use the rc -b flag to keep sysupdate in memory when /rc/bin/sysupdate gets updated itself during a sysupdate, rc gets confused when continuing reading the original file, but it gets data from the updated file causing confusion. the -b flag forces rc to read the original file as a whole before starting execution preventing this issue. updating this should be fine as the file has been shrunk from 230 bytes to 224 bytes.
--- a/rc/bin/sysupdate
+++ b/rc/bin/sysupdate
@@ -1,11 +1,9 @@
-#!/bin/rc
-
+#!/bin/rc -b
rfork en
-
cd /
if(! test -d .git)
bind -ac /dist/plan9front /
if(! ~ `{git/branch} heads/front)
- >[1=2] echo sysupdate: must be on "front" branch to pull
+ >[1=2] echo sysupdate: must be on "front" to pull
if not
git/pull -u gits://git.9front.org/plan9front/plan9front