shithub: riscv

Download patch

ref: 51669adf2446385b38bab4efcb4133c19e9be806
parent: 3cf83fa259b70ab6289b9106c04da7c27d4b34d1
author: Alex Musolino <alex@musolino.id.au>
date: Wed May 11 12:33:37 EDT 2022

inst/prepdisk: fix invocations of test(1)

Test(1) was fixed some time ago [1] to properly parse all of its
command line arguments.  As such, we need to be more careful about
using test(1) with globbing patterns.

[1] changeset b562b269cea44e09d3c642b1a9452e16bd8ce3b5

--- a/rc/bin/inst/prepdisk
+++ b/rc/bin/inst/prepdisk
@@ -14,7 +14,8 @@
 
 switch($1) {
 case checkready
-	if(! test -f /dev/sd*/plan9*){
+	disks=(/dev/sd*/plan9*)
+	if(! test -f $disks(1)){
 		prepdisk=notdone
 		export prepdisk
 	}
@@ -43,7 +44,8 @@
 	disk/prep -p $disk >`{basename -d $disk}^/ctl >[2]/dev/null
 
 case checkdone
-	if(! test -f /dev/sd*/9fat)
+	disks=(/dev/sd*/9fat)
+	if(! test -f $disks(1))
 		prepdisk=ready
 	if(! ~ $prepdisk ready)
 		prepdisk=done