NetBSD Problem Report #56983

From tsutsui@ceres.dti.ne.jp  Sat Aug 27 20:57:42 2022
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C70181A923A
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 27 Aug 2022 20:57:42 +0000 (UTC)
Message-Id: <202208272057.27RKvXoN019650@ceres.dti.ne.jp>
Date: Sun, 28 Aug 2022 05:57:33 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: "SMALL test, no fallback usage" by test(1) looks annoying
X-Send-Pr-Version: 3.95

>Number:         56983
>Category:       bin
>Synopsis:       "SMALL test, no fallback usage" by test(1) looks annoying
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 27 21:00:00 +0000 2022
>Closed-Date:    Fri Dec 23 12:51:37 +0000 2022
>Last-Modified:  Fri Dec 23 12:51:37 +0000 2022
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.3 and also HEAD
>Organization:
>Environment:
System: NetBSD 9.3
Architecture: all
Machine: all
>Description:
During installation with crunched installation binaries built
with -DSMALL via crunchgen(8), sometimes test(1) command show

[: SMALL test, no fallback usage

messages.

However, this looks annoying for users because:
- no clue for users what "SMALL" means
  (it's a compile options for developers to shrink binaries)
- "no fallback usage" doesn't give useful information at all
  (at least it should says "something wrong in scripts/expressions")

>How-To-Repeat:
See PR/54835 and the following commits that fixed expressions
"SMALL test(1)" didn't support:
 https://github.com/NetBSD/src/commit/39410f1b7f2eb4154b9448dbc52316f930b034ea
 https://github.com/NetBSD/src/commit/b2ce4d8f22a0af29ac135a43ef73fb3adddbacca
 https://github.com/NetBSD/src/commit/8d8b188fe13f826671a3f28f6c37252afc301653

Maybe we have still leftovers:

---
Index: amiga/floppies/inst-common/dot.commonutils
===================================================================
RCS file: /cvsroot/src/distrib/amiga/floppies/inst-common/dot.commonutils,v
retrieving revision 1.8
diff -u -p -d -r1.8 dot.commonutils
--- amiga/floppies/inst-common/dot.commonutils	26 Jul 2003 17:06:29 -0000	1.8
+++ amiga/floppies/inst-common/dot.commonutils	27 Aug 2022 20:52:23 -0000
@@ -49,7 +49,7 @@ GUNZIP=/usr/bin/gunzip
 Set_tmp_dir()
 {
 	def_tmp_dir=`pwd`
-	if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
+	if [ "$def_tmp_dir" = "/" ] || [ "$def_tmp_dir" = "/mnt" ]; then
 		def_tmp_dir="$dest_dir"usr/distrib
 	fi

@@ -78,7 +78,7 @@ Load_fd()
 {
 	Tmp_dir
 	which=
-	while [ "$which" != "a" -a "$which" != "b" ]; do
+	while [ "$which" != "a" ] && [ "$which" != "b" ]; do
 		echo -n	"Read from which floppy drive ('a' or 'b')? [a] "
 		read which
 		if [ "X$which" = "X" ]; then
Index: amiga/miniroot/dot.profile
===================================================================
RCS file: /cvsroot/src/distrib/amiga/miniroot/dot.profile,v
retrieving revision 1.10
diff -u -p -d -r1.10 dot.profile
--- amiga/miniroot/dot.profile	27 Jul 2008 19:55:19 -0000	1.10
+++ amiga/miniroot/dot.profile	27 Aug 2022 20:52:23 -0000
@@ -71,7 +71,7 @@ if [ "X${DONEPROFILE}" = "X" ]; then
 		# Check if the answer is valid (in range). Note that an answer
 		# < 0 cannot happen because the sed(1) above also removes the
 		# sign.
-		if [ -z "$_ans" -o "$_ans" -ge $_num ]; then
+		if [ -z "$_ans" ] || [ "$_ans" -ge $_num ]; then
 		    echo "You entered an invalid response, please try again."
 		    continue
 		fi
Index: utils/script-installer/dot.commonutils
===================================================================
RCS file: /cvsroot/src/distrib/utils/script-installer/dot.commonutils,v
retrieving revision 1.7
diff -u -p -d -r1.7 dot.commonutils
--- utils/script-installer/dot.commonutils	26 Jul 2003 17:07:37 -0000	1.7
+++ utils/script-installer/dot.commonutils	27 Aug 2022 20:52:25 -0000
@@ -49,7 +49,7 @@ GUNZIP=/usr/bin/gunzip
 Set_tmp_dir()
 {
 	def_tmp_dir=`pwd`
-	if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
+	if [ "$def_tmp_dir" = "/" ] || [ "$def_tmp_dir" = "/mnt" ]; then
 		def_tmp_dir="$dest_dir"usr/distrib
 	fi

@@ -81,7 +81,7 @@ Load_fd()
 #	echo "Don't forget that you can't load from the drive you booted from."
 	echo ""

-	while [ "$which" != "0" -a "$which" != "1" ]; do
+	while [ "$which" != "0" ] && [ "$which" != "1" ]; do
 		echo -n	"Read from which floppy drive ('0' or '1')? [0] "
 		read which
 		if [ "X$which" = "X" ]; then
Index: vax/inst-common/dot.commonutils
===================================================================
RCS file: /cvsroot/src/distrib/vax/inst-common/dot.commonutils,v
retrieving revision 1.5
diff -u -p -d -r1.5 dot.commonutils
--- vax/inst-common/dot.commonutils	26 Jul 2003 17:07:41 -0000	1.5
+++ vax/inst-common/dot.commonutils	27 Aug 2022 20:52:25 -0000
@@ -39,7 +39,7 @@
 Set_tmp_dir()
 {
 	def_tmp_dir=`pwd`
-	if [ "$def_tmp_dir" = "/" -o "$def_tmp_dir" = "/mnt" ]; then
+	if [ "$def_tmp_dir" = "/" ] || [ "$def_tmp_dir" = "/mnt" ]; then
 		def_tmp_dir=/mnt/usr/distrib
 	fi

@@ -68,7 +68,7 @@ Load_fd()
 {
 	Tmp_dir
 	which=
-	while [ "$which" != "a" -a "$which" != "b" ]; do
+	while [ "$which" != "a" ] && [ "$which" != "b" ]; do
 		echo -n	"Read from which floppy drive ('a' or 'b')? [a] "
 		read which
 		if [ "X$which" = "X" ]; then

---

>Fix:
It would be better to just say "unsupported operator/expression"?

>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56983 CVS commit: src/bin/test
Date: Sat, 27 Aug 2022 21:18:39 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sat Aug 27 21:18:39 UTC 2022

 Modified Files:
 	src/bin/test: test.c

 Log Message:
 PR 56983 Izumi Tsutsui: fix confusing message in test(1) with -DSMALL


 To generate a diff of this commit:
 cvs rdiff -u -r1.44 -r1.45 src/bin/test/test.c

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

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 27 Aug 2022 21:21:00 +0000
State-Changed-Why:
I improved the message.

Please commit your script fixes, they all look fine to me.

Do we want the message change in -9?


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: dholland@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: bin/56983 ("SMALL test, no fallback usage" by test(1) looks annoying)
Date: Sun, 28 Aug 2022 20:54:50 +0900

 > State-Changed-Why:
 > I improved the message.

 Looks much better.
 ---
  #ifdef SMALL
 -	error("SMALL test, no fallback usage");
 +	error("unsupported expression when built with -DSMALL");
 ---

 > Please commit your script fixes, they all look fine to me.

 Thanks, I'll do later.

 > Do we want the message change in -9?

 Maybe yes, for (rare) Tier-II port users?
 (I'm not sure if any Tier-I ports still use crunchgen for installation)

 ---
 Izumi Tsutsui

From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56983 CVS commit: src/distrib
Date: Sun, 28 Aug 2022 12:44:01 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Sun Aug 28 12:44:01 UTC 2022

 Modified Files:
 	src/distrib/amiga/floppies/inst-common: dot.commonutils
 	src/distrib/amiga/miniroot: dot.profile
 	src/distrib/utils/script-installer: dot.commonutils
 	src/distrib/vax/inst-common: dot.commonutils

 Log Message:
 Avoid more obsolescent binary primaries not supported by crunched test(1).

 See PR/54835 and PR/56983 for details.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 \
     src/distrib/amiga/floppies/inst-common/dot.commonutils
 cvs rdiff -u -r1.10 -r1.11 src/distrib/amiga/miniroot/dot.profile
 cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/script-installer/dot.commonutils
 cvs rdiff -u -r1.5 -r1.6 src/distrib/vax/inst-common/dot.commonutils

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

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/56983 ("SMALL test, no fallback usage" by test(1) looks
 annoying)
Date: Sun, 28 Aug 2022 19:56:11 +0000

 On Sun, Aug 28, 2022 at 12:00:03PM +0000, Izumi Tsutsui wrote:
  >  > Do we want the message change in -9?
  >  
  >  Maybe yes, for (rare) Tier-II port users?
  >  (I'm not sure if any Tier-I ports still use crunchgen for installation)

 Whether or not they do, I think they all have /rescue.

 I was wondering more about -9 vs. -10. But given that -10 seems to be
 hanging fire indefinitely, I'll go ahead and file the pullup.

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/56983 ("SMALL test, no fallback usage" by test(1) looks
 annoying)
Date: Mon, 29 Aug 2022 00:09:00 +0000

 On Sun, Aug 28, 2022 at 08:00:02PM +0000, David Holland wrote:
  >  I was wondering more about -9 vs. -10. But given that -10 seems to be
  >  hanging fire indefinitely, I'll go ahead and file the pullup.

 It is [pullup-9 #1507].

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56983 CVS commit: [netbsd-9] src/bin/test
Date: Mon, 29 Aug 2022 16:04:26 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Aug 29 16:04:26 UTC 2022

 Modified Files:
 	src/bin/test [netbsd-9]: test.c

 Log Message:
 Pull up following revision(s) (requested by dholland in ticket #1507):

 	bin/test/test.c: revision 1.45

 PR 56983 Izumi Tsutsui: fix confusing message in test(1) with -DSMALL


 To generate a diff of this commit:
 cvs rdiff -u -r1.43 -r1.43.2.1 src/bin/test/test.c

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56983 CVS commit: [netbsd-9] src/distrib
Date: Tue, 30 Aug 2022 18:35:20 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Aug 30 18:35:20 UTC 2022

 Modified Files:
 	src/distrib/amiga/floppies/inst-common [netbsd-9]: dot.commonutils
 	src/distrib/amiga/miniroot [netbsd-9]: dot.profile
 	src/distrib/atari/floppies/common [netbsd-9]: dot.profile
 	src/distrib/utils/script-installer [netbsd-9]: dot.commonutils
 	src/distrib/vax/inst-common [netbsd-9]: dot.commonutils

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

 	distrib/atari/floppies/common/dot.profile: revision 1.9
 	distrib/vax/inst-common/dot.commonutils: revision 1.6
 	distrib/amiga/miniroot/dot.profile: revision 1.11
 	distrib/utils/script-installer/dot.commonutils: revision 1.8
 	distrib/amiga/floppies/inst-common/dot.commonutils: revision 1.9

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

 The same problem as PR/54835 of the miniroot scripts, i.e.
 avoid and replace use of -o binary primary marked obsolescent
 by POSIX.1-2017:
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_12
 8_16

 Noticed on installation of NetBSD 9.3 on TT030, and
 maybe should be pulled up to netbsd-9.

 Avoid more obsolescent binary primaries not supported by crunched test(1).

 See PR/54835 and PR/56983 for details.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.8.102.1 \
     src/distrib/amiga/floppies/inst-common/dot.commonutils
 cvs rdiff -u -r1.10 -r1.10.64.1 src/distrib/amiga/miniroot/dot.profile
 cvs rdiff -u -r1.7.6.1 -r1.7.6.2 \
     src/distrib/atari/floppies/common/dot.profile
 cvs rdiff -u -r1.7 -r1.7.102.1 \
     src/distrib/utils/script-installer/dot.commonutils
 cvs rdiff -u -r1.5 -r1.5.102.1 src/distrib/vax/inst-common/dot.commonutils

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

State-Changed-From-To: feedback->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Fri, 23 Dec 2022 12:51:37 +0000
State-Changed-Why:
Fix committed and pulled up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.