Module Name:    src
Committed By:   christos
Date:           Thu Apr  4 21:00:20 UTC 2019

Modified Files:
        src/distrib/amiga/miniroot: install.md
        src/distrib/atari/floppies/prepare: install.md
        src/distrib/hp300/miniroot: install.md
        src/distrib/mvme68k/miniroot: install.md
        src/distrib/sparc: install.md
        src/distrib/sun2/miniroot: install.md
        src/distrib/sun3/miniroot: install.md

Log Message:
modernize, and avoid -a -o


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/distrib/amiga/miniroot/install.md
cvs rdiff -u -r1.4 -r1.5 src/distrib/atari/floppies/prepare/install.md
cvs rdiff -u -r1.15 -r1.16 src/distrib/hp300/miniroot/install.md
cvs rdiff -u -r1.6 -r1.7 src/distrib/mvme68k/miniroot/install.md
cvs rdiff -u -r1.22 -r1.23 src/distrib/sparc/install.md
cvs rdiff -u -r1.3 -r1.4 src/distrib/sun2/miniroot/install.md
cvs rdiff -u -r1.3 -r1.4 src/distrib/sun3/miniroot/install.md

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/amiga/miniroot/install.md
diff -u src/distrib/amiga/miniroot/install.md:1.28 src/distrib/amiga/miniroot/install.md:1.29
--- src/distrib/amiga/miniroot/install.md:1.28	Tue Aug 15 08:07:23 2017
+++ src/distrib/amiga/miniroot/install.md	Thu Apr  4 17:00:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.28 2017/08/15 12:07:23 mlelstv Exp $
+#	$NetBSD: install.md,v 1.29 2019/04/04 21:00:19 christos Exp $
 #
 #
 # Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@ __mount_kernfs() {
 	#
 	# Force kern_fs to be mounted
 	#
-	if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+	if [ ! -d /kern ] || [ ! -e /kern/msgbuf ]; then
 		mkdir /kern > /dev/null 2>&1
 		/sbin/mount_kernfs /kern /kern >/dev/null 2>&1
 	fi
@@ -126,12 +126,12 @@ md_prep_disklabel() {
 
 md_view_labels_possible=1
 md_view_labels() {
-	_DKDEVS=`md_get_diskdevs`
+	_DKDEVS=$(md_get_diskdevs)
 	echo "If you like, you can now examine the labels of your disks."
 	echo ""
 	echo -n "Available are "${_DKDEVS}". Look at which? [skip this step] "
 	getresp	"done"
-	while [ "X$resp" != "Xdone" ]; do
+	while [ "${resp:-done}" != "done" ]; do
 		echo ""
 		disklabel ${resp}
 		echo ""
@@ -169,9 +169,9 @@ __welcome_banner_1
 This program is designed to help you upgrade your NetBSD system in a
 simple and rational way.
 
-As a reminder, installing the `etc' binary set is NOT recommended.
+As a reminder, installing the 'etc' binary set is NOT recommended.
 Once the rest of your system has been upgraded, you should manually
-merge any changes to files in the `etc' set into those files which
+merge any changes to files in the 'etc' set into those files which
 already exist on your system.
 __welcome_banner_2
 	fi
@@ -194,7 +194,7 @@ __welcome_banner_3
 md_not_going_to_install() {
 	cat << \__not_going_to_install_1
 
-OK, then.  Enter `halt' at the prompt to halt the machine.  Once the
+OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
 machine has halted, power-cycle the system to load new boot code.
 
 Note: If you wish to have another try. Just type '^D' at the prompt. After
@@ -247,7 +247,7 @@ md_copy_kernel() {
 			echo -n "on the installation filesystem? (y/n) [n] "
 			resp="n"
 			getresp ""
-			if [ "${resp}" != "y" -a "${resp}" != "Y" ]; then
+			if [ "${resp}" != "y" ] && [ "${resp}" != "Y" ]; then
 				return
 			fi
 		fi
@@ -267,7 +267,7 @@ The following disk devices are installed
 the disk device containing the partition with the netbsd kernel:
 __md_copy_kernel_1
 
-	_DKDEVS=`md_get_diskdevs`
+	_DKDEVS=$(md_get_diskdevs)
 	echo    "$_DKDEVS"
 	echo	"fd0"
 	echo	""
@@ -280,14 +280,14 @@ __md_copy_kernel_1
 
 	# Get the directory where the file lives
 	resp=""		# force one iteration
-	while [ "X${resp}" = X"" ]; do
+	while [ -z "${resp}" ]; do
 		echo "Enter the directory relative to the mount point that"
 		echo -n "contains the file. [${_directory}] "
 		getresp "${_directory}"
 	done
 	_directory=$resp
 
-	_sets=`(cd /mnt2/$_directory; ls netbsd* 2> /dev/null)`
+	_sets=$(cd /mnt2/$_directory; ls netbsd* 2> /dev/null)
 	if [ -z "$_sets" ]; then
 		echo "There are no NetBSD kernels available in \"$1\""
 		umount -f /mnt2 > /dev/null 2>&1
@@ -331,7 +331,7 @@ md_lib_is_aout() {
 	test -h $1 && return 1
 	test -f $1 || return 1
 
-	[ "`dd if=$1 bs=1 skip=1 count=3 2> /dev/null`" = "ELF" ] && return 1
+	[ "$(dd if=$1 bs=1 skip=1 count=3 2> /dev/null)" = "ELF" ] && return 1
 	return 0
 }
 

Index: src/distrib/atari/floppies/prepare/install.md
diff -u src/distrib/atari/floppies/prepare/install.md:1.4 src/distrib/atari/floppies/prepare/install.md:1.5
--- src/distrib/atari/floppies/prepare/install.md:1.4	Sat Nov 25 04:41:45 2017
+++ src/distrib/atari/floppies/prepare/install.md	Thu Apr  4 17:00:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.4 2017/11/25 09:41:45 tsutsui Exp $
+#	$NetBSD: install.md,v 1.5 2019/04/04 21:00:19 christos Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@ md_set_term() {
 
 __mount_kernfs() {
 	# Make sure kernfs is mounted.
-	if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+	if [ ! -d /kern ] || [ ! -e /kern/msgbuf ]; then
 		mkdir /kern > /dev/null 2>&1
 		/sbin/mount_kernfs /kern /kern
 	fi
@@ -125,9 +125,9 @@ You will now be given the opportunity to
 disks on your system.
 __md_prep_disklabel_4
 
-	_DKDEVS=`rmel ${1} ${_DKDEVS}`
-	resp="X"	# force at least one iteration
-	while [ "X$resp" != X"done" ]; do
+	_DKDEVS=$(rmel ${1} ${_DKDEVS})
+	resp="not-done"	# force at least one iteration
+	while [ "$resp" != "done" ]; do
 		labelmoredisks
 	done
 }
@@ -162,7 +162,7 @@ __welcome_banner_1
 md_not_going_to_install() {
 	cat << \__not_going_to_install_1
 
-OK, then.  Enter `halt' at the prompt to halt the machine.  Once the
+OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
 machine has halted, power-cycle the system to load new boot code.
 
 Note: If you wish to have another try. Just type '^D' at the prompt. After

Index: src/distrib/hp300/miniroot/install.md
diff -u src/distrib/hp300/miniroot/install.md:1.15 src/distrib/hp300/miniroot/install.md:1.16
--- src/distrib/hp300/miniroot/install.md:1.15	Sun Feb  6 13:26:51 2011
+++ src/distrib/hp300/miniroot/install.md	Thu Apr  4 17:00:19 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: install.md,v 1.15 2011/02/06 18:26:51 tsutsui Exp $
+#	$NetBSD: install.md,v 1.16 2019/04/04 21:00:19 christos Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -120,10 +120,10 @@ hp300_init_label_scsi_disk() {
 	# $1 is the disk to label
 
 	# Name the disks we install in the temporary fstab.
-	if [ "X${_disk_instance}" = "X" ]; then
+	if [ -z "${_disk_instance}" ]; then
 		_disk_instance="0"
 	else
-		_disk_instance=`expr $_disk_instance + 1`
+		_disk_instance=$(expr $_disk_instance + 1)
 	fi
 	_cur_disk_name="install-disk-${_disk_instance}"
 
@@ -168,35 +168,35 @@ __scsi_label_1
 	_secsize="$resp"
 
 	resp=""		# force one iteration
-	while [ "X${resp}" = "X" ]; do
+	while [ -z "${resp}" ]; do
 		echo -n	"Number of cylinders? "
 		getresp ""
 	done
 	_cylinders="$resp"
-	_fudge_cyl=`expr $_cylinders + 1`
+	_fudge_cyl=$(expr $_cylinders + 1)
 
 	resp=""		# force one iteration
-	while [ "X${resp}" = "X" ]; do
+	while [ -z "${resp}" ]; do
 		echo -n	"Number of tracks (heads)? "
 		getresp ""
 	done
 	_tracks_per_cyl="$resp"
 
 	resp=""		# force one iteration
-	while [ "X${resp}" = "X" ]; do
+	while [ -z "${resp}" ]; do
 		echo -n	"Number of disk sectors (blocks)? "
 		getresp ""
 	done
 	_nsectors="$resp"
 
 	# Calculate some values we need.
-	_sec_per_cyl=`expr $_nsectors / $_cylinders`
-	_sec_per_track=`expr $_sec_per_cyl / $_tracks_per_cyl`
-	_new_c_size=`expr $_sec_per_track \* $_tracks_per_cyl \* $_cylinders`
+	_sec_per_cyl=$(expr $_nsectors / $_cylinders)
+	_sec_per_track=$(expr $_sec_per_cyl / $_tracks_per_cyl)
+	_new_c_size=$(expr $_sec_per_track \* $_tracks_per_cyl \* $_cylinders)
 
 	# Emit a disktab entry, suitable for getting started.
-	# What we have is a `c' partition with the total number of
-	# blocks, and an `a' partition with 1 sector; just large enough
+	# What we have is a 'c' partition with the total number of
+	# blocks, and an 'a' partition with 1 sector; just large enough
 	# to open.  Don't ask.
 	echo	"" >> /etc/disktab
 	echo	"# Created by install" >> /etc/disktab
@@ -207,18 +207,18 @@ __scsi_label_1
 	echo	"	:pc#${_nsectors}:" >> /etc/disktab
 
 	# Ok, here's what we need to do.  First of all, we install
-	# this initial label by opening the `c' partition of the disk
-	# and using the `-r' flag for disklabel(8).  However, because
+	# this initial label by opening the 'c' partition of the disk
+	# and using the '-r' flag for disklabel(8).  However, because
 	# of limitations in disklabel(8), we've had to fudge the number
 	# of cylinders up 1 so that disklabel(8) doesn't complain about
-	# `c' running past the end of the disk, which can be quite
+	# 'c' running past the end of the disk, which can be quite
 	# common even with OEM HP drives!  So, we've given ourselves
-	# an `a' partition, which is the minimum needed to open the disk
+	# an 'a' partition, which is the minimum needed to open the disk
 	# so that we can perform the DIOCWDLABEL ioctl.  So, once the
-	# initial label is installed, we open the `a' partition so that
+	# initial label is installed, we open the 'a' partition so that
 	# we can fix up the number of cylinders and make the size of
-	# `c' come out to (ncyl * ntracks_per_cyl * nsec_per_track).
-	# After that's done, we re-open `c' and let the user actually
+	# 'c' come out to (ncyl * ntracks_per_cyl * nsec_per_track).
+	# After that's done, we re-open 'c' and let the user actually
 	# edit the partition table.  It's horrible, I know.  Bleh.
 
 	disklabel -W ${1}
@@ -273,10 +273,10 @@ hp300_init_label_hpib_disk() {
 	# the model number for the provided disk.
 	_hpib_disktype=""
 	if dmesg | grep_check_q "${1}: "; then
-		_hpib_disktype=HP`dmesg | plain_grep "${1}: " | sort -u | \
-		    awk '{print $2}'`
+		_hpib_disktype=HP$(dmesg | plain_grep "${1}: " | sort -u | \
+		    awk '{print $2}')
 	fi
-	if [ "X${_hpib_disktype}" = "X" ]; then
+	if [ -z "${_hpib_disktype}" ]; then
 		echo ""
 		echo "ERROR: $1 doesn't appear to exist?!"
 		rval="1"
@@ -361,7 +361,7 @@ md_labeldisk() {
 			# Check to see if installing the default was
 			# successful.  If so, go ahead and pop into the
 			# disklabel editor.
-			if [ "X${rval}" != X"0" ]; then
+			if [ "${rval}" != "0" ]; then
 				echo "Sorry, can't label this disk."
 				echo ""
 				return;
@@ -437,9 +437,9 @@ You will now be given the opportunity to
 disks on your system.
 __md_prep_disklabel_4
 
-	_DKDEVS=`rmel ${ROOTDISK} ${_DKDEVS}`
-	resp="X"	# force at least one iteration
-	while [ "X$resp" != X"done" ]; do
+	_DKDEVS=$(rmel ${ROOTDISK} ${_DKDEVS})
+	resp="not-done"	# force at least one iteration
+	while [ "$resp" != "done" ]; do
 		labelmoredisks
 	done
 }

Index: src/distrib/mvme68k/miniroot/install.md
diff -u src/distrib/mvme68k/miniroot/install.md:1.6 src/distrib/mvme68k/miniroot/install.md:1.7
--- src/distrib/mvme68k/miniroot/install.md:1.6	Wed Mar 10 18:13:09 2010
+++ src/distrib/mvme68k/miniroot/install.md	Thu Apr  4 17:00:19 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: install.md,v 1.6 2010/03/10 23:13:09 abs Exp $
+#	$NetBSD: install.md,v 1.7 2019/04/04 21:00:19 christos Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -50,7 +50,7 @@ md_set_term() {
 
 __mount_kernfs() {
 	# Make sure kernfs is mounted.
-	if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+	if [ ! -d /kern ] || [ ! -e /kern/msgbuf ]; then
 		mkdir /kern > /dev/null 2>&1
 		/sbin/mount_kernfs /kern /kern >/dev/null 2>&1
 	fi
@@ -161,10 +161,10 @@ Here is an example of what the partition
 you have entered the disklabel editor. Disk partition sizes and offsets
 are in sector (most likely 512 bytes) units. Make sure these size/offset
 pairs are on cylinder boundaries (the number of sector per cylinder is
-given in the `sectors/cylinder' entry, which is not shown here).
+given in the 'sectors/cylinder' entry, which is not shown here).
 
 Do not change any parameters except the partition layout and the label name.
-It's probably also wisest not to touch the `8 partitions:' line, even
+It's probably also wisest not to touch the '8 partitions:' line, even
 in case you have defined less than eight partitions.
 
 [Example]

Index: src/distrib/sparc/install.md
diff -u src/distrib/sparc/install.md:1.22 src/distrib/sparc/install.md:1.23
--- src/distrib/sparc/install.md:1.22	Sat Sep 25 10:29:13 2010
+++ src/distrib/sparc/install.md	Thu Apr  4 17:00:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.22 2010/09/25 14:29:13 tsutsui Exp $
+#	$NetBSD: install.md,v 1.23 2019/04/04 21:00:19 christos Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -107,10 +107,10 @@ md_checkfordisklabel() {
 	local rval
 	local cfdl
 
-	cfdl=`disklabel $1 2>&1 > /dev/null | \
+	cfdl=$(disklabel $1 2>&1 > /dev/null | \
 	    sed -n -e '/no disk label/{s/.*/ndl/p;q;}; \
 		 /disk label corrupted/{s/.*/dlc/p;q;}; \
-		 $s/.*/no/p'`
+		 $s/.*/no/p')
 	if [ x$cfdl = xndl ]; then
 		rval=1
 	elif [ x$cfdl = xdlc ]; then
@@ -155,10 +155,10 @@ Here is an example of what the partition
 you have entered the disklabel editor. Disk partition sizes and offsets
 are in sector (most likely 512 bytes) units. Make sure these size/offset
 pairs are on cylinder boundaries (the number of sector per cylinder is
-given in the `sectors/cylinder' entry, which is not shown here).
+given in the 'sectors/cylinder' entry, which is not shown here).
 
 Do not change any parameters except the partition layout and the label name.
-It's probably also wisest not to touch the `8 partitions:' line, even
+It's probably also wisest not to touch the '8 partitions:' line, even
 in case you have defined less than eight partitions.
 
 [Example]
@@ -215,9 +215,9 @@ __welcome_banner_1
 This program is designed to help you upgrade your NetBSD system in a
 simple and rational way.
 
-As a reminder, installing the `etc' binary set is NOT recommended.
+As a reminder, installing the 'etc' binary set is NOT recommended.
 Once the rest of your system has been upgraded, you should manually
-merge any changes to files in the `etc' set into those files which
+merge any changes to files in the 'etc' set into those files which
 already exist on your system.
 __welcome_banner_2
 	fi
@@ -241,7 +241,7 @@ __welcome_banner_3
 md_not_going_to_install() {
 	cat << \__not_going_to_install_1
 
-OK, then.  Enter `halt' at the prompt to halt the machine.  Once the
+OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
 machine has halted, power-cycle the system to load new boot code.
 
 __not_going_to_install_1
@@ -268,7 +268,7 @@ md_lib_is_aout() {
 	test -h $1 && return 1
 	test -f $1 || return 1
 
-	[ "`dd if=$1 bs=1 skip=1 count=3 2> /dev/null`" = "ELF" ] && return 1
+	[ "$(dd if=$1 bs=1 skip=1 count=3 2> /dev/null)" = "ELF" ] && return 1
 	return 0
 }
 

Index: src/distrib/sun2/miniroot/install.md
diff -u src/distrib/sun2/miniroot/install.md:1.3 src/distrib/sun2/miniroot/install.md:1.4
--- src/distrib/sun2/miniroot/install.md:1.3	Wed Apr 30 09:10:49 2008
+++ src/distrib/sun2/miniroot/install.md	Thu Apr  4 17:00:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.3 2008/04/30 13:10:49 martin Exp $
+#	$NetBSD: install.md,v 1.4 2019/04/04 21:00:19 christos Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ md_set_term() {
 
 __mount_kernfs() {
 	# Make sure kernfs is mounted.
-	if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+	if [ ! -d /kern ] || [ ! -e /kern/msgbuf ]; then
 		mkdir /kern > /dev/null 2>&1
 		/sbin/mount_kernfs /kern /kern
 	fi
@@ -176,9 +176,9 @@ __welcome_banner_1
 This program is designed to help you upgrade your NetBSD system in a
 simple and rational way.
 
-As a reminder, installing the `etc' binary set is NOT recommended.
+As a reminder, installing the 'etc' binary set is NOT recommended.
 Once the rest of your system has been upgraded, you should manually
-merge any changes to files in the `etc' set into those files which
+merge any changes to files in the 'etc' set into those files which
 already exist on your system.
 __welcome_banner_2
 	fi
@@ -201,7 +201,7 @@ __welcome_banner_3
 md_not_going_to_install() {
 	cat << \__not_going_to_install_1
 
-OK, then.  Enter `halt' at the prompt to halt the machine.  Once the
+OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
 machine has halted, power-cycle the system to load new boot code.
 
 __not_going_to_install_1

Index: src/distrib/sun3/miniroot/install.md
diff -u src/distrib/sun3/miniroot/install.md:1.3 src/distrib/sun3/miniroot/install.md:1.4
--- src/distrib/sun3/miniroot/install.md:1.3	Wed Apr 30 09:10:49 2008
+++ src/distrib/sun3/miniroot/install.md	Thu Apr  4 17:00:19 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.3 2008/04/30 13:10:49 martin Exp $
+#	$NetBSD: install.md,v 1.4 2019/04/04 21:00:19 christos Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ md_set_term() {
 
 __mount_kernfs() {
 	# Make sure kernfs is mounted.
-	if [ ! -d /kern -o ! -e /kern/msgbuf ]; then
+	if [ ! -d /kern ] || [ ! -e /kern/msgbuf ]; then
 		mkdir /kern > /dev/null 2>&1
 		/sbin/mount_kernfs /kern /kern
 	fi
@@ -149,7 +149,7 @@ __md_prep_disklabel_1
 
 md_copy_kernel() {
 	if [ ! -f /mnt/netbsd ]; then
-		set -- `sysctl -n hw.model`
+		set -- $(sysctl -n hw.model)
 		echo -n "No kernel set extracted. Copying $1 miniroot kernel..."
 		cp -p /netbsd.$1 /mnt/netbsd
 		echo "done."
@@ -176,9 +176,9 @@ __welcome_banner_1
 This program is designed to help you upgrade your NetBSD system in a
 simple and rational way.
 
-As a reminder, installing the `etc' binary set is NOT recommended.
+As a reminder, installing the 'etc' binary set is NOT recommended.
 Once the rest of your system has been upgraded, you should manually
-merge any changes to files in the `etc' set into those files which
+merge any changes to files in the 'etc' set into those files which
 already exist on your system.
 __welcome_banner_2
 	fi
@@ -201,7 +201,7 @@ __welcome_banner_3
 md_not_going_to_install() {
 	cat << \__not_going_to_install_1
 
-OK, then.  Enter `halt' at the prompt to halt the machine.  Once the
+OK, then.  Enter 'halt' at the prompt to halt the machine.  Once the
 machine has halted, power-cycle the system to load new boot code.
 
 __not_going_to_install_1

Reply via email to