Source-Changes-HG archive

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

[src/trunk]: src/distrib/common/bootimage allow some invocations of expr(1) t...



details:   https://anonhg.NetBSD.org/src/rev/685e270f76fd
branches:  trunk
changeset: 366112:685e270f76fd
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun May 15 00:05:24 2022 +0000

description:
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.

diffstat:

 distrib/common/bootimage/Makefile.bootimage |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r dba373cb12c0 -r 685e270f76fd distrib/common/bootimage/Makefile.bootimage
--- a/distrib/common/bootimage/Makefile.bootimage       Sat May 14 21:04:34 2022 +0000
+++ b/distrib/common/bootimage/Makefile.bootimage       Sun May 15 00:05:24 2022 +0000
@@ -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 @@
 .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 @@
 
 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



Home | Main Index | Thread Index | Old Index