CVS commit: [netbsd-9] src/distrib/miniroot

2021-06-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  5 10:40:09 UTC 2021

Modified Files:
src/distrib/miniroot [netbsd-9]: install.sub

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1281):

distrib/miniroot/install.sub: revision 1.60

Handle recent ifconfig(8) outputs in the miniroot installation script.

- Remove netmask slash notation for IP addresses,
  which has been changed between NetBSD 7.x and 8.0:
  http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ifconfig/af_inet.c#rev1.24

- Ignore inet6 entries, which miniroot scripts don't support

Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.48.2.4 -r1.48.2.5 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.48.2.4 src/distrib/miniroot/install.sub:1.48.2.5
--- src/distrib/miniroot/install.sub:1.48.2.4	Mon Dec 14 17:26:36 2020
+++ src/distrib/miniroot/install.sub	Sat Jun  5 10:40:08 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.48.2.4 2020/12/14 17:26:36 martin Exp $
+#	$NetBSD: install.sub,v 1.48.2.5 2021/06/05 10:40:08 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -403,8 +403,9 @@ configure_ifs() {
 	fi
 
 	set -- $(ifconfig $_interface_name | sed -n '
-		/^[ 	]*inet/{
+		/^[ 	]*inet /{
 		s/inet//
+		s,/[0-9]*,,
 		s/--> [0-9.][0-9.]*//
 		s/netmask//
 		s/broadcast//



CVS commit: [netbsd-9] src/distrib/miniroot

2020-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 21 15:26:47 UTC 2020

Modified Files:
src/distrib/miniroot [netbsd-9]: install.sub

Log Message:
Pull up following revision(s) (requested by kre in ticket #632):

distrib/miniroot/install.sub: revision 1.52

The idiom

set $whatever
while [ $# - gt 10 ]; do shift 10; done
eval echo \$$#

fails when $# turns out to be 10 (or any multiple), it would need
to be instead

while [ $# -ge 10 ]; do shift 9; done

but there hasn't been a shell that cannot handle ${10} (etc) correctly
in a very long time, so let's just use that instead (properly quoted,
in case IFS happens to contain a digit for some bizarre reason).

We should also "set -f" / "set +f" (or better, restore the prev setting of -f)
around the "set $whatever" part, but if that was ever going to cause a problem
here, it would have already, so leave that for now.


To generate a diff of this commit:
cvs rdiff -u -r1.48.2.2 -r1.48.2.3 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.48.2.2 src/distrib/miniroot/install.sub:1.48.2.3
--- src/distrib/miniroot/install.sub:1.48.2.2	Tue Jan 21 11:30:28 2020
+++ src/distrib/miniroot/install.sub	Tue Jan 21 15:26:46 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.48.2.2 2020/01/21 11:30:28 martin Exp $
+#	$NetBSD: install.sub,v 1.48.2.3 2020/01/21 15:26:46 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -114,8 +114,7 @@ cutlast () {
 	read _a; set -- $_a
 	IFS="$_oifs"
 	if [ "$1" = "" ]; then return; fi
-	while [ "$#" -gt 10 ]; do shift 10; done
-	eval echo \$$#
+	eval echo '"${'"$#"'}"'
 }
 
 firstchar () {
@@ -135,8 +134,7 @@ basename () {
 	IFS="/"
 	set -- $1
 	IFS="$_oifs"
-	while [ "$#" -gt 10 ]; do shift 10; done
-	eval echo \$$#
+	eval echo '"${'"$#"'}"'
 }
 
 dir_has_sets() {



CVS commit: [netbsd-9] src/distrib/miniroot

2020-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 21 11:30:28 UTC 2020

Modified Files:
src/distrib/miniroot [netbsd-9]: install.sub

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #622):

distrib/miniroot/install.sub: revision 1.50
distrib/miniroot/install.sub: revision 1.51

Fix miniroot installation failure on network configuration.  PR/54833

No particular comment in the PR.
Should be pulled up to netbsd-9.

Fix "[: SMALL test, no fallback usage" error on miniroot installation.

Avoid and replace use of '-a', '(' and ')' operatos marked obsolescent
by modern POSIX.1-2017:

 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16

as suggested by kre@ in PR/54835.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.48.2.1 -r1.48.2.2 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.48.2.1 src/distrib/miniroot/install.sub:1.48.2.2
--- src/distrib/miniroot/install.sub:1.48.2.1	Sun Nov 17 07:04:35 2019
+++ src/distrib/miniroot/install.sub	Tue Jan 21 11:30:28 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.48.2.1 2019/11/17 07:04:35 martin Exp $
+#	$NetBSD: install.sub,v 1.48.2.2 2020/01/21 11:30:28 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -429,7 +429,7 @@ configure_ifs() {
 
 	# Get netmask
 	resp=""		# force one iteration
-	while [ -n "${resp}" ]; do
+	while [ -z "${resp}" ]; do
 		echo -n "Netmask? [$_interface_mask] "
 		getresp "$_interface_mask"
 		_interface_mask=$resp
@@ -1531,7 +1531,7 @@ unmount_fs()
 		_fstab=$1
 	fi
 
-	if [ ! \( -f $_fstab -a -s $_fstab \) ]; then
+	if ! [ -f "${_fstab}" ] || ! [ -s "${_fstab}" ]; then
 		echo "fstab empty" > /dev/tty
 		return
 	fi