Source-Changes-HG archive

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

[src/pkgviews]: src/usr.sbin/pkg_install/view Use a less verbose construct th...



details:   https://anonhg.NetBSD.org/src/rev/8484f18bcaee
branches:  pkgviews
changeset: 534275:8484f18bcaee
user:      jlam <jlam%NetBSD.org@localhost>
date:      Wed Aug 27 08:09:25 2003 +0000

description:
Use a less verbose construct that does the same thing.

diffstat:

 usr.sbin/pkg_install/view/linkfarm.sh |   6 ++----
 usr.sbin/pkg_install/view/pkg_view.sh |  10 +++-------
 2 files changed, 5 insertions(+), 11 deletions(-)

diffs (55 lines):

diff -r d7d560baf2c7 -r 8484f18bcaee usr.sbin/pkg_install/view/linkfarm.sh
--- a/usr.sbin/pkg_install/view/linkfarm.sh     Wed Aug 27 00:28:16 2003 +0000
+++ b/usr.sbin/pkg_install/view/linkfarm.sh     Wed Aug 27 08:09:25 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: linkfarm.sh,v 1.1.2.14 2003/08/24 09:28:39 jlam Exp $
+# $NetBSD: linkfarm.sh,v 1.1.2.15 2003/08/27 08:09:25 jlam Exp $
 
 #
 # Copyright (c) 2002 Alistair G. Crooks.  All rights reserved.
@@ -56,9 +56,7 @@
 }
 
 checkdir() {
-       if [ -d "$1" ]; then
-               :
-       else
+       if [ ! -d "$1" ]; then
                echo "linkfarm: \`$1' doesn't exist"
                exit 1
        fi
diff -r d7d560baf2c7 -r 8484f18bcaee usr.sbin/pkg_install/view/pkg_view.sh
--- a/usr.sbin/pkg_install/view/pkg_view.sh     Wed Aug 27 00:28:16 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.sh     Wed Aug 27 08:09:25 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: pkg_view.sh,v 1.1.2.32 2003/08/26 22:13:04 jlam Exp $
+# $NetBSD: pkg_view.sh,v 1.1.2.33 2003/08/27 08:09:26 jlam Exp $
 
 #
 # Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -62,9 +62,7 @@
 }
 
 checkpkg() {
-       if [ -d "$2/$1" ]; then
-               :
-       else
+       if [ ! -d "$2/$1" ]; then
                echo "pkg_view: \`$1' doesn't exist in \`$2'" 1>&2
                exit 1
        fi
@@ -228,9 +226,7 @@
                ;;
        delete)
                checkpkg $1 ${depot_pkg_dbdir}
-               if [ -f ${pkg_dbdir}/$1/+DEPOT ]; then
-                       :
-               else
+               if [ ! -f ${pkg_dbdir}/$1/+DEPOT ]; then
                        echo "pkg_view: \`$1' doesn't exist in $viewstr" 1>&2
                        exit 1
                fi



Home | Main Index | Thread Index | Old Index