Source-Changes-HG archive

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

[src/trunk]: src/distrib/common Remove use of test ([) -o (and a couple of ot...



details:   https://anonhg.NetBSD.org/src/rev/b9c1fab7b904
branches:  trunk
changeset: 433492:b9c1fab7b904
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Sep 16 21:49:18 2018 +0000

description:
Remove use of test ([) -o (and a couple of other trivial cleanups).

diffstat:

 distrib/common/buildfloppies.sh |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 249b2c77eb74 -r b9c1fab7b904 distrib/common/buildfloppies.sh
--- a/distrib/common/buildfloppies.sh   Sun Sep 16 21:41:34 2018 +0000
+++ b/distrib/common/buildfloppies.sh   Sun Sep 16 21:49:18 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: buildfloppies.sh,v 1.18 2017/02/11 03:07:06 christos Exp $
+# $NetBSD: buildfloppies.sh,v 1.19 2018/09/16 21:49:18 kre Exp $
 #
 # Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -58,12 +58,12 @@
 
 plural()
 {
-       [ $1 -ne 1 ] && echo "s"
+       [ "$1" -ne 1 ] && echo "s"
 }
 
 roundup()
 {
-       echo $(( ( $1 + $2 - 1 ) / ( $2 ) ))
+       echo $(( ( ( $1 ) + ( $2 ) - 1 ) / ( $2 ) ))
 }
 
 
@@ -148,8 +148,10 @@
        set -- $(ls -ln $file)
        file_bytes=$5
        pad_bytes=$(($(roundup $file_bytes 512) * 512 - $file_bytes))
-       [ "$file_bytes" != 0 -o "$file" = "${file#USTAR.volsize.}" ] &&
+       if [ "$file_bytes" != 0 ] || [ "$file" = "${file#USTAR.volsize.}" ]
+       then
                msg="$msg $file $pad_bytes,"
+       fi
        free_space=$(($free_space - 512 - $file_bytes - $pad_bytes))
 done
 echo "Free space in last tar block:$msg"



Home | Main Index | Thread Index | Old Index