Module Name:    src
Committed By:   mrg
Date:           Sun May 15 00:05:24 UTC 2022

Modified Files:
        src/distrib/common/bootimage: Makefile.bootimage

Log Message:
allow some invocations of expr(1) to "fail" - expr(1) returns "1" is
the expression expands to "0" or empty, and sometimes these values end
up correctly being 0.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/distrib/common/bootimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.29 src/distrib/common/bootimage/Makefile.bootimage:1.30
--- src/distrib/common/bootimage/Makefile.bootimage:1.29	Sat Sep 25 08:54:29 2021
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun May 15 00:05:24 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.29 2021/09/25 08:54:29 maya Exp $
+#	$NetBSD: Makefile.bootimage,v 1.30 2022/05/15 00:05:24 mrg Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -201,8 +201,8 @@ LABELSECTORS?=	2048	# 1MB aligned for mo
 .endif
 
 FSSECTORS!=	expr ${IMAGESECTORS} - ${SWAPSECTORS} - ${LABELSECTORS} \
-		    - ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS}
-FSSIZE!=	expr ${FSSECTORS} \* 512
+		    - ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS} || test $$? -eq 1 || exit 1
+FSSIZE!=	expr ${FSSECTORS} \* 512 || test $$? -eq 1 || exit 1
 
 # parameters for disklabel and MBR
 HEADS=		64
@@ -217,9 +217,9 @@ MBRFAT?=	6	# 16-bit FAT, more than 32M
 
 BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} \
 		    - ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS}
-FSOFFSET!=	expr ${LABELSECTORS} + ${EFISECTORS} + ${FATSECTORS}
+FSOFFSET!=	expr ${LABELSECTORS} + ${EFISECTORS} + ${FATSECTORS} || test $$? -eq 1 || exit 1
 SWAPOFFSET!=	expr ${LABELSECTORS} + ${FSSECTORS} \
-		    + ${EFISECTORS} + ${FATSECTORS}
+		    + ${EFISECTORS} + ${FATSECTORS} || test $$? -eq 1 || exit 1
 FATOFFSET=	${LABELSECTORS}
 
 # parameters for sunlabel

Reply via email to