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 Output the version number if -V...



details:   https://anonhg.NetBSD.org/src/rev/2b8713a831a1
branches:  pkgviews
changeset: 534223:2b8713a831a1
user:      jlam <jlam%NetBSD.org@localhost>
date:      Mon Jul 14 13:47:52 2003 +0000

description:
Output the version number if -V is specified on the command line, and
allow "pkg_view -V" to work with no further arguments.

diffstat:

 usr.sbin/pkg_install/view/pkg_view.sh |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 1ecc2d39d249 -r 2b8713a831a1 usr.sbin/pkg_install/view/pkg_view.sh
--- a/usr.sbin/pkg_install/view/pkg_view.sh     Mon Jul 14 13:39:46 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.sh     Mon Jul 14 13:47:52 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: pkg_view.sh,v 1.1.2.8 2003/07/14 13:30:57 jlam Exp $
+# $NetBSD: pkg_view.sh,v 1.1.2.9 2003/07/14 13:47:52 jlam Exp $
 
 #
 # Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -52,13 +52,18 @@
        exit 1
 }
 
+version() {
+       echo "20030713"
+       exit 0
+}
+
 stowdir=""
 prefix=${PREFIX:-/usr/pkg}
 view=${PKG_VIEW:-""}
 ignorefiles=${PLIST_IGNORE_FILES:-info/dir}
 dflt_pkg_dbdir=${PKG_DBDIR:-/var/db/pkg}
 
-while [ $# -gt 1 ]; do
+while [ $# -gt 0 ]; do
        case "$1" in
        -d)             stowdir=$2; shift ;;
        -d*)            stowdir=`echo $1 | $sedprog -e 's|^-d||'` ;;
@@ -66,6 +71,7 @@
        -i*)            ignorefiles="$ignorefiles `echo $1 | $sedprog -e 's|^-i||'`" ;;
        -p)             prefix=$2; shift ;;
        -p*)            prefix=`echo $1 | $sedprog -e 's|^-p||'` ;;
+       -V)             version ;;
        -v)             view=$2; shift ;;
        --view=*)       view=`echo $1 | $sedprog -e 's|--view=||'` ;;
        --)             shift; break ;;



Home | Main Index | Thread Index | Old Index