NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/56983: "SMALL test, no fallback usage" by test(1) looks annoying



>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:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 27 21:00:00 +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"?



Home | Main Index | Thread Index | Old Index