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/cfa84c4689ec
branches:  trunk
changeset: 835931:cfa84c4689ec
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 d8090f96cd66 -r cfa84c4689ec 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