head	1.18;
access;
symbols
	netbsd-11-0-RC4:1.18
	netbsd-11-0-RC3:1.18
	netbsd-11-0-RC2:1.18
	netbsd-11-0-RC1:1.18
	perseant-exfatfs-base-20250801:1.18
	netbsd-11:1.18.0.6
	netbsd-11-base:1.18
	netbsd-10-1-RELEASE:1.18
	perseant-exfatfs-base-20240630:1.18
	perseant-exfatfs:1.18.0.4
	perseant-exfatfs-base:1.18
	netbsd-8-3-RELEASE:1.16
	netbsd-9-4-RELEASE:1.16
	netbsd-10-0-RELEASE:1.18
	netbsd-10-0-RC6:1.18
	netbsd-10-0-RC5:1.18
	netbsd-10-0-RC4:1.18
	netbsd-10-0-RC3:1.18
	netbsd-10-0-RC2:1.18
	netbsd-10-0-RC1:1.18
	netbsd-10:1.18.0.2
	netbsd-10-base:1.18
	netbsd-9-3-RELEASE:1.16
	cjep_sun2x-base1:1.16
	cjep_sun2x:1.16.0.38
	cjep_sun2x-base:1.16
	cjep_staticlib_x-base1:1.16
	netbsd-9-2-RELEASE:1.16
	cjep_staticlib_x:1.16.0.36
	cjep_staticlib_x-base:1.16
	netbsd-9-1-RELEASE:1.16
	phil-wifi-20200421:1.16
	phil-wifi-20200411:1.16
	is-mlppp:1.16.0.34
	is-mlppp-base:1.16
	phil-wifi-20200406:1.16
	netbsd-8-2-RELEASE:1.16
	netbsd-9-0-RELEASE:1.16
	netbsd-9-0-RC2:1.16
	netbsd-9-0-RC1:1.16
	phil-wifi-20191119:1.16
	netbsd-9:1.16.0.32
	netbsd-9-base:1.16
	phil-wifi-20190609:1.16
	netbsd-8-1-RELEASE:1.16
	netbsd-8-1-RC1:1.16
	pgoyette-compat-merge-20190127:1.16
	pgoyette-compat-20190127:1.16
	pgoyette-compat-20190118:1.16
	pgoyette-compat-1226:1.16
	pgoyette-compat-1126:1.16
	pgoyette-compat-1020:1.16
	pgoyette-compat-0930:1.16
	pgoyette-compat-0906:1.16
	netbsd-7-2-RELEASE:1.16
	pgoyette-compat-0728:1.16
	netbsd-8-0-RELEASE:1.16
	phil-wifi:1.16.0.30
	phil-wifi-base:1.16
	pgoyette-compat-0625:1.16
	netbsd-8-0-RC2:1.16
	pgoyette-compat-0521:1.16
	pgoyette-compat-0502:1.16
	pgoyette-compat-0422:1.16
	netbsd-8-0-RC1:1.16
	pgoyette-compat-0415:1.16
	pgoyette-compat-0407:1.16
	pgoyette-compat-0330:1.16
	pgoyette-compat-0322:1.16
	pgoyette-compat-0315:1.16
	netbsd-7-1-2-RELEASE:1.16
	pgoyette-compat:1.16.0.28
	pgoyette-compat-base:1.16
	netbsd-7-1-1-RELEASE:1.16
	matt-nb8-mediatek:1.16.0.26
	matt-nb8-mediatek-base:1.16
	perseant-stdc-iso10646:1.16.0.24
	perseant-stdc-iso10646-base:1.16
	netbsd-8:1.16.0.22
	netbsd-8-base:1.16
	prg-localcount2-base3:1.16
	prg-localcount2-base2:1.16
	prg-localcount2-base1:1.16
	prg-localcount2:1.16.0.20
	prg-localcount2-base:1.16
	pgoyette-localcount-20170426:1.16
	bouyer-socketcan-base1:1.16
	pgoyette-localcount-20170320:1.16
	netbsd-7-1:1.16.0.18
	netbsd-7-1-RELEASE:1.16
	netbsd-7-1-RC2:1.16
	netbsd-7-nhusb-base-20170116:1.16
	bouyer-socketcan:1.16.0.16
	bouyer-socketcan-base:1.16
	pgoyette-localcount-20170107:1.16
	netbsd-7-1-RC1:1.16
	pgoyette-localcount-20161104:1.16
	netbsd-7-0-2-RELEASE:1.16
	localcount-20160914:1.16
	netbsd-7-nhusb:1.16.0.14
	netbsd-7-nhusb-base:1.16
	pgoyette-localcount-20160806:1.16
	pgoyette-localcount-20160726:1.16
	pgoyette-localcount:1.16.0.12
	pgoyette-localcount-base:1.16
	netbsd-7-0-1-RELEASE:1.16
	netbsd-7-0:1.16.0.10
	netbsd-7-0-RELEASE:1.16
	netbsd-7-0-RC3:1.16
	netbsd-7-0-RC2:1.16
	netbsd-7-0-RC1:1.16
	netbsd-5-2-3-RELEASE:1.13
	netbsd-5-1-5-RELEASE:1.13
	netbsd-6-0-6-RELEASE:1.13
	netbsd-6-1-5-RELEASE:1.13
	netbsd-7:1.16.0.8
	netbsd-7-base:1.16
	yamt-pagecache-base9:1.16
	yamt-pagecache-tag8:1.13
	netbsd-6-1-4-RELEASE:1.13
	netbsd-6-0-5-RELEASE:1.13
	tls-earlyentropy:1.16.0.6
	tls-earlyentropy-base:1.16
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.16
	riastradh-drm2-base3:1.16
	netbsd-6-1-3-RELEASE:1.13
	netbsd-6-0-4-RELEASE:1.13
	netbsd-5-2-2-RELEASE:1.13
	netbsd-5-1-4-RELEASE:1.13
	netbsd-6-1-2-RELEASE:1.13
	netbsd-6-0-3-RELEASE:1.13
	netbsd-5-2-1-RELEASE:1.13
	netbsd-5-1-3-RELEASE:1.13
	netbsd-6-1-1-RELEASE:1.13
	riastradh-drm2-base2:1.16
	riastradh-drm2-base1:1.16
	riastradh-drm2:1.16.0.2
	riastradh-drm2-base:1.16
	netbsd-6-1:1.13.0.32
	netbsd-6-0-2-RELEASE:1.13
	netbsd-6-1-RELEASE:1.13
	netbsd-6-1-RC4:1.13
	netbsd-6-1-RC3:1.13
	agc-symver:1.16.0.4
	agc-symver-base:1.16
	netbsd-6-1-RC2:1.13
	netbsd-6-1-RC1:1.13
	yamt-pagecache-base8:1.13
	netbsd-5-2:1.13.0.30
	netbsd-6-0-1-RELEASE:1.13
	yamt-pagecache-base7:1.13
	netbsd-5-2-RELEASE:1.13
	netbsd-5-2-RC1:1.13
	matt-nb6-plus-nbase:1.13
	yamt-pagecache-base6:1.13
	netbsd-6-0:1.13.0.28
	netbsd-6-0-RELEASE:1.13
	netbsd-6-0-RC2:1.13
	tls-maxphys:1.13.0.26
	tls-maxphys-base:1.16
	matt-nb6-plus:1.13.0.24
	matt-nb6-plus-base:1.13
	netbsd-6-0-RC1:1.13
	yamt-pagecache-base5:1.13
	yamt-pagecache-base4:1.13
	netbsd-6:1.13.0.22
	netbsd-6-base:1.13
	netbsd-5-1-2-RELEASE:1.13
	netbsd-5-1-1-RELEASE:1.13
	yamt-pagecache-base3:1.13
	yamt-pagecache-base2:1.13
	yamt-pagecache:1.13.0.4
	yamt-pagecache-base:1.13
	cherry-xenmp:1.13.0.20
	cherry-xenmp-base:1.13
	bouyer-quota2-nbase:1.13
	bouyer-quota2:1.13.0.18
	bouyer-quota2-base:1.13
	matt-mips64-premerge-20101231:1.13
	matt-nb5-mips64-premerge-20101231:1.13
	matt-nb5-pq3:1.13.0.16
	matt-nb5-pq3-base:1.13
	netbsd-5-1:1.13.0.14
	netbsd-5-1-RELEASE:1.13
	netbsd-5-1-RC4:1.13
	matt-nb5-mips64-k15:1.13
	netbsd-5-1-RC3:1.13
	netbsd-5-1-RC2:1.13
	netbsd-5-1-RC1:1.13
	netbsd-5-0-2-RELEASE:1.13
	matt-nb5-mips64-premerge-20091211:1.13
	matt-premerge-20091211:1.13
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.13
	matt-nb4-mips64-k7-u2a-k9b:1.13
	matt-nb5-mips64-u1-k1-k5:1.13
	matt-nb5-mips64:1.13.0.12
	netbsd-5-0-1-RELEASE:1.13
	jym-xensuspend-nbase:1.13
	netbsd-5-0:1.13.0.10
	netbsd-5-0-RELEASE:1.13
	netbsd-5-0-RC4:1.13
	netbsd-5-0-RC3:1.13
	netbsd-5-0-RC2:1.13
	jym-xensuspend:1.13.0.8
	jym-xensuspend-base:1.13
	netbsd-5-0-RC1:1.13
	netbsd-5:1.13.0.6
	netbsd-5-base:1.13
	matt-mips64-base2:1.13
	matt-mips64:1.12.0.34
	netbsd-4-0-1-RELEASE:1.12
	wrstuden-revivesa-base-3:1.13
	wrstuden-revivesa-base-2:1.13
	wrstuden-fixsa-newbase:1.12
	wrstuden-revivesa-base-1:1.13
	yamt-pf42-base4:1.13
	yamt-pf42-base3:1.13
	hpcarm-cleanup-nbase:1.13
	yamt-pf42-baseX:1.12
	yamt-pf42-base2:1.13
	wrstuden-revivesa:1.13.0.2
	wrstuden-revivesa-base:1.13
	yamt-pf42:1.12.0.32
	yamt-pf42-base:1.12
	keiichi-mipv6:1.12.0.30
	keiichi-mipv6-base:1.12
	matt-armv6-nbase:1.12
	matt-armv6-prevmlocking:1.12
	wrstuden-fixsa-base-1:1.12
	netbsd-4-0:1.12.0.28
	netbsd-4-0-RELEASE:1.12
	cube-autoconf:1.12.0.26
	cube-autoconf-base:1.12
	netbsd-4-0-RC5:1.12
	netbsd-4-0-RC4:1.12
	netbsd-4-0-RC3:1.12
	netbsd-4-0-RC2:1.12
	netbsd-4-0-RC1:1.12
	matt-armv6:1.12.0.24
	matt-armv6-base:1.12
	matt-mips64-base:1.12
	hpcarm-cleanup:1.12.0.22
	hpcarm-cleanup-base:1.12
	netbsd-3-1-1-RELEASE:1.12
	netbsd-3-0-3-RELEASE:1.12
	wrstuden-fixsa:1.12.0.20
	wrstuden-fixsa-base:1.12
	abandoned-netbsd-4-base:1.12
	abandoned-netbsd-4:1.12.0.14
	netbsd-3-1:1.12.0.16
	netbsd-3-1-RELEASE:1.12
	netbsd-3-0-2-RELEASE:1.12
	netbsd-3-1-RC4:1.12
	netbsd-3-1-RC3:1.12
	netbsd-3-1-RC2:1.12
	netbsd-3-1-RC1:1.12
	netbsd-4:1.12.0.18
	netbsd-4-base:1.12
	netbsd-3-0-1-RELEASE:1.12
	netbsd-3-0:1.12.0.12
	netbsd-3-0-RELEASE:1.12
	netbsd-3-0-RC6:1.12
	netbsd-3-0-RC5:1.12
	netbsd-3-0-RC4:1.12
	netbsd-3-0-RC3:1.12
	netbsd-3-0-RC2:1.12
	netbsd-3-0-RC1:1.12
	netbsd-2-0-3-RELEASE:1.12
	netbsd-2-1:1.12.0.10
	netbsd-2-1-RELEASE:1.12
	netbsd-2-1-RC6:1.12
	netbsd-2-1-RC5:1.12
	netbsd-2-1-RC4:1.12
	netbsd-2-1-RC3:1.12
	netbsd-2-1-RC2:1.12
	netbsd-2-1-RC1:1.12
	netbsd-2-0-2-RELEASE:1.12
	netbsd-3:1.12.0.8
	netbsd-3-base:1.12
	netbsd-2-0-1-RELEASE:1.12
	netbsd-2:1.12.0.6
	netbsd-2-base:1.12
	netbsd-2-0-RELEASE:1.12
	netbsd-2-0-RC5:1.12
	netbsd-2-0-RC4:1.12
	netbsd-2-0-RC3:1.12
	netbsd-2-0-RC2:1.12
	netbsd-2-0-RC1:1.12
	netbsd-2-0:1.12.0.4
	netbsd-2-0-base:1.12
	netbsd-1-6-PATCH002-RELEASE:1.12
	netbsd-1-6-PATCH002:1.12
	netbsd-1-6-PATCH002-RC4:1.12
	netbsd-1-6-PATCH002-RC3:1.12
	netbsd-1-6-PATCH002-RC2:1.12
	netbsd-1-6-PATCH002-RC1:1.12
	netbsd-1-6-PATCH001:1.12
	netbsd-1-6-PATCH001-RELEASE:1.12
	netbsd-1-6-PATCH001-RC3:1.12
	netbsd-1-6-PATCH001-RC2:1.12
	netbsd-1-6-PATCH001-RC1:1.12
	fvdl_fs64_base:1.12
	netbsd-1-6-RELEASE:1.12
	netbsd-1-6-RC3:1.12
	netbsd-1-6-RC2:1.12
	netbsd-1-6-RC1:1.12
	netbsd-1-6:1.12.0.2
	netbsd-1-6-base:1.12
	netbsd-1-5-PATCH003:1.9.4.2
	netbsd-1-5-PATCH002:1.9.4.2
	netbsd-1-5-PATCH001:1.9.4.2
	netbsd-1-5-RELEASE:1.9.4.2
	netbsd-1-5-BETA2:1.9.4.2
	netbsd-1-5-BETA:1.9.4.2
	netbsd-1-4-PATCH003:1.5.2.3
	netbsd-1-5-ALPHA2:1.9.4.1
	netbsd-1-5:1.9.0.4
	netbsd-1-5-base:1.9
	minoura-xpg4dl:1.9.0.2
	minoura-xpg4dl-base:1.9
	netbsd-1-4-PATCH002:1.5
	wrstuden-devbsize-19991221:1.9
	wrstuden-devbsize:1.8.0.4
	wrstuden-devbsize-base:1.9
	comdex-fall-1999:1.8.0.2
	comdex-fall-1999-base:1.8
	netbsd-1-4-PATCH001:1.5
	netbsd-1-4-RELEASE:1.5
	netbsd-1-4:1.5.0.2
	netbsd-1-4-base:1.5;
locks; strict;
comment	@# @;


1.18
date	2021.12.05.08.09.30;	author msaitoh;	state Exp;
branches;
next	1.17;
commitid	PKFxyFmb1QWr4rjD;

1.17
date	2021.09.17.02.12.16;	author christos;	state Exp;
branches;
next	1.16;
commitid	YGwiz64LAOWgDf9D;

1.16
date	2013.02.17.02.36.21;	author christos;	state Exp;
branches;
next	1.15;

1.15
date	2013.02.17.01.26.47;	author christos;	state Exp;
branches;
next	1.14;

1.14
date	2013.02.17.01.20.57;	author christos;	state Exp;
branches;
next	1.13;

1.13
date	2008.04.30.13.10.50;	author martin;	state Exp;
branches
	1.13.4.1
	1.13.26.1;
next	1.12;

1.12
date	2000.07.22.16.04.57;	author erh;	state Exp;
branches
	1.12.32.1;
next	1.11;

1.11
date	2000.07.05.18.56.20;	author he;	state Exp;
branches;
next	1.10;

1.10
date	2000.07.03.17.22.20;	author he;	state Exp;
branches;
next	1.9;

1.9
date	99.11.05.20.16.56;	author erh;	state Exp;
branches
	1.9.4.1;
next	1.8;

1.8
date	99.07.02.15.12.15;	author simonb;	state Exp;
branches
	1.8.4.1;
next	1.7;

1.7
date	99.06.24.14.39.48;	author christos;	state Exp;
branches;
next	1.6;

1.6
date	99.06.10.00.32.23;	author simonb;	state Exp;
branches;
next	1.5;

1.5
date	99.03.16.18.57.31;	author christos;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	99.01.27.05.50.29;	author erh;	state Exp;
branches;
next	1.3;

1.3
date	99.01.27.00.02.55;	author hubertf;	state Exp;
branches;
next	1.2;

1.2
date	98.11.12.05.39.45;	author erh;	state Exp;
branches;
next	1.1;

1.1
date	98.11.07.09.36.54;	author erh;	state Exp;
branches;
next	;

1.13.4.1
date	2014.05.22.11.36.43;	author yamt;	state Exp;
branches;
next	;
commitid	HJV5p3BoaVY5KwBx;

1.13.26.1
date	2013.02.25.00.27.47;	author tls;	state Exp;
branches;
next	;

1.12.32.1
date	2008.05.18.12.30.09;	author yamt;	state Exp;
branches;
next	;

1.9.4.1
date	2000.07.03.17.52.57;	author he;	state Exp;
branches;
next	1.9.4.2;

1.9.4.2
date	2000.08.12.12.55.39;	author drochner;	state Exp;
branches;
next	;

1.8.4.1
date	99.12.27.18.29.23;	author wrstuden;	state Exp;
branches;
next	;

1.5.2.1
date	2000.07.03.17.17.08;	author he;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2000.07.05.20.49.15;	author he;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2000.08.14.14.06.58;	author he;	state Exp;
branches;
next	;


desc
@@


1.18
log
@s/supress/suppress/
@
text
@#!/bin/sh
#	$NetBSD: checkver,v 1.17 2021/09/17 02:12:16 christos Exp $
#
# Copyright (c) 1998 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Eric Haszlakiewicz.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

#--------------------------------------------------------------------#
# checkver - 
#	Check for libraries that appear to be newer than the
#	one we're about to install.
#
# checkver [-q] [-v shlib_version_file] -d [installedlibdir [library name]]"
# checkver [-q] [-v shlib_version_file] -s [setlistdir [library name]]"
# checkver [-q] [-v shlib_version_file] -f liblistfile [library name]"
#
# One of -d, -s or -f must be specified.
#
# all: If library name is not specified it is assumed to
#	be the name of the current directory.
#
# -d: Checks the version against the installed libraries.
#	If no further arguments are given "/usr/lib" is
#	used as the location of installed libraries.
#
# -s: Checks the version against the sets.  If no argument
#	follows the sets directory defaults to "/usr/src/distrib/sets/lists".
#	The directory may be specified as either the top of the
#	source tree or as the lists directory.
#
# -f: Checks the version against the provided list.  A filename
#	must be supplied.
#
# -v: Specify the filename of the shlib_version file.  Defaults
#     to "./shlib_version".
#
# This script produces no output if all library version are not
# large than the source version.  If an installed library with a
# version greater than the source is found, checkver prints a
# header and a list of the names of the offending installed libraries.
#
# The header may be suppressed by passing "-q" as the first argument.
#

TMP=/tmp/checkver.$$
PROG="$(basename "$0")"
# Can't trap 11 (SEGV) in the Real Bourne Shell, since it uses it for
# internal malloc!
trap "exit 2" 1 2 3 4 5 6 7 8 10 12 13 14 15
trap "[ -d $TMP ] && rm -rf $TMP" 0

Usage() {
cat << EOF 1>&2
Usage: $PROG [-q] [-v version_file] -d [installedlibdir [library name]]
       $PROG [-q] [-v version_file] -s [setlistdir [library name]]
       $PROG [-q] [-v version_file] -f liblistfile [library name]
       $PROG is a script that looks for installed libraries with
       versions greater than that in the version file.
       For more information, read the comments.
EOF
	exit 1
}

basedir=/usr/src
setsdir=$basedir/distrib/sets/lists
libdir=/usr/lib
shlib_version=./shlib_version

error=0
quiet=0
usedir=0
usefile=0
usesets=0
CWD=$(pwd)
: ${AWK:=awk}

fixone() {
	eval $(${AWK} -v 'LIB=$1' '
BEGIN {
	gsub(".*\.so\.", "", LIB);
	split(LIB, VER, ".");
	printf("local instmajor=%d\n", V[1] + 0);
	printf("local instminor=%d\n", V[2] + 0);
	printf("local instteeny=%d\n", V[3] + 0);
}')
	local ms="The following libraries have versions greater than the source"

	# If they're greater than the source, complain.
	if [ "0$major" -eq "0$instmajor" ]; then
		if [ "0$minor" -eq "0$instminor" ]; then
			if [ "0$teeny" -lt "0$instteeny" ]; then
				if [ $error -eq 0 -a $quiet -eq 0 ]; then
					echo "$ms" 1>&2
				fi
				echo $1 1>&2
				error=1
			fi
		elif [ "0$minor" -lt "0$instminor" ]; then
			if [ $error -eq 0 -a $quiet -eq 0 ]; then
				echo "$ms" 1>&2
			fi
			echo $1 1>&2
			error=1
		fi
	elif [ "0$major" -lt "0$instmajor" ]; then
		if [ $error -eq 0 -a $quiet -eq 0 ]; then
			echo "$ms" 1>&2
		fi
		echo $1 1>&2
		error=1
	fi
}

while getopts df:shqv: f; do
	case $f in
	d)	usedir=1 
		if [ $usefile -eq 1 -o $usesets -eq 1 ]; then
			Usage
		fi;;
	f)	usefile=1; arg1=$OPTARG
		if [ $usedir -eq 1 -o $usesets -eq 1 ]; then
			Usage 
		fi;;
	s)	usesets=1 
		if [ $usedir -eq 1 -o $usefile -eq 1 ]; then
			Usage
		fi;;
	v)	shlib_version=$OPTARG;;
	q)	quiet=1;;
	*)	Usage;;
	esac
done

shift $(($OPTIND - 1))

if [ $usedir -eq 0 -a $usefile -eq 0 -a $usesets -eq 0 ]; then
	Usage
fi

if [ $usefile -eq 1 ]; then
	LIBLIST="$arg1"
else
	if ! mkdir -m 0700 $TMP; then
		echo "$PROG: Unable to create temp directory." 1>&2
		exit 2
	fi
	LIBLIST=$TMP/libs.lst
fi

# Build list from the installed libraries.
if [ $usedir -eq 1 ]; then
	if [ -n "$1" ]; then
		libdir="$1"
	fi
	for f in $libdir; do
		ls $f/lib*.so.*.*
	done > $LIBLIST 2> /dev/null
fi

# Build list from set lists.  Parameter may be either
# the "lists" directory or the top of the source tree.
if [ $usesets -eq 1 ]; then
	if [ -n "$1" ]; then
		setsdir="$1"
		if [ -d "$setsdir/distrib/sets/lists" ]; then
			setsdir="$setsdir/distrib/sets/lists"
		fi
	fi
	(cd $setsdir;
	 cat */[a-z]* |
	 grep '^./usr/lib/lib.*\.so\.[0-9][0-9]*\.[0-9][0-9]*' |
	 sort -u > $LIBLIST)
fi

#
# The file $LIBLIST now contains a list of libraries.
#
if [ -z "$2" ]; then
	makefile=$CWD/Makefile
	libname=$(grep '^LIB=' $makefile | sed -e 's/^LIB=[[:space:]]*//')

	# Assume the library name is the name of the current directory.
	if [ -z "$libname" ]; then
		libname=$(basename $CWD)
	fi
else
	    libname="$2"
fi
echo $libname | grep "^lib" 1>&2 2> /dev/null
if [ $? != 0 ]; then
	libname="lib$libname"
fi


if [ ! -f $shlib_version ]; then
	echo "$PROG: unable to find $shlib_version" 1>&2
	exit 2
fi

# Grab major and minor numbers from the source.
. $shlib_version

if [ -z "$minor" -o -z "$major" ]; then
	echo "$PROG: $shlib_version doesn't contain the version." 1>&2
	exit 2
fi

# Find every shared object library with the same base name.
for instlib in $(grep $libname.so "$LIBLIST"); do
	# Grab the major and minor from the installed library.
	fixone "$instlib"
done

exit $error
@


1.17
log
@Robustness fix: handle libraries that contain . in their basename.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.16 2013/02/17 02:36:21 christos Exp $
d66 1
a66 1
# The header may be supressed by passing "-q" as the first argument.
@


1.16
log
@remove -'s from options
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.15 2013/02/17 01:26:47 christos Exp $
d99 1
d102 8
a109 3
	local instmajor=$(basename $1 | awk 'BEGIN { FS="." } { print $3 }')
	local instminor=$(basename $1 | awk 'BEGIN { FS="." } { print $4 }')
	local instteeny=$(basename $1 | awk 'BEGIN { FS="." } { print $5 + 0 }')
@


1.15
log
@Use $0
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.14 2013/02/17 01:20:57 christos Exp $
d146 2
a147 2
	-v)	shlib_version=$OPTARG;;
	-q)	quiet=1;;
@


1.14
log
@modernize
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.13 2008/04/30 13:10:50 martin Exp $
d70 1
a70 1
PROG="$(basename "$PROG")"
@


1.13
log
@Convert TNF licenses to new 2 clause variant
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.12 2000/07/22 16:04:57 erh Exp $
d70 1
d77 9
a85 6
    echo "Usage: $1 [-q] [-v version_file] -d [installedlibdir [library name]]"
    echo "       $1 [-q] [-v version_file] -s [setlistdir [library name]]"
    echo "       $1 [-q] [-v version_file] -f liblistfile [library name]"
    echo "	$1 is a script that looks for installed libraries with"
    echo "	   versions greater than that in the version file."
    echo "	For more information, read the comments."
d98 52
a149 28
CWD=`pwd`
args=`getopt "df:shqv:" "$@@"`
if [ $? -ne 0 ] ; then
    Usage $0
    exit 0
fi

set -- $args

while [ ! -z "$1" ]; do
    case "$1" in
	-d) usedir=1 ; shift
	    if [ $usefile -eq 1 -o $usesets -eq 1 ]; then
		Usage $0 ; exit 2
	    fi;;
	-f) usefile=1 ; arg1=$2 ; shift ; shift
	    if [ $usedir -eq 1 -o $usesets -eq 1 ]; then
		Usage $0 ; exit 2
	    fi;;
	-s) usesets=1 ; shift
	    if [ $usedir -eq 1 -o $usefile -eq 1 ]; then
		Usage $0 ; exit 2
	    fi;;
	-v) shlib_version=$2; shift ; shift ;;
	-h) Usage $0 ; exit 0;;
	-q) quiet=1 ; shift;;
	--) shift ; break;;
    esac
d152 4
a155 2
if [ $usedir -eq 0 -a $usefile -eq 0 -a $usesets -eq 0 ] ; then
    Usage $0 ; exit 2
d158 2
a159 2
if [ $usefile -eq 1 ] ; then
   LIBLIST="$arg1"
d161 5
a165 6
   mkdir -m 0700 $TMP
   if [ $?  != 0 ]; then
	echo "$0: Unable to create temp directory."
	exit 2
   fi
   LIBLIST=$TMP/libs.lst
d169 7
a175 7
if [ $usedir -eq 1 ] ; then
    if [ "X$1" != "X" ] ; then
	libdir="$1"
    fi
    for f in $libdir ; do
	ls $f/lib*.so.*.*
    done > $LIBLIST 2> /dev/null
d180 6
a185 5
if [ $usesets -eq 1 ] ; then
    if [ "X$1" != "X" ] ; then
	setsdir="$1"
	if [ -d "$setsdir/distrib/sets/lists" ] ; then
	    setsdir="$setsdir/distrib/sets/lists"
d187 4
a190 5
    fi
    (cd $setsdir ;
     cat */[a-z]* | grep '^./usr/lib/lib.*\.so\.[0-9][0-9]*\.[0-9][0-9]*' \
		  | sort -u > $LIBLIST
    )
d196 8
a203 9

if [ "X$2" = "X" ] ; then
    makefile=$CWD/Makefile
    libname=`grep '^LIB=' $makefile | sed -e 's/^LIB=[[:space:]]*//'`

    # Assume the library name is the name of the current directory.
    if [ -z $libname ]; then
	libname=`basename $CWD`
    fi
d205 1
a205 1
    libname="$2"
d209 1
a209 1
    libname="lib$libname"
d213 3
a215 3
if [ ! -f $shlib_version ] ; then
    echo "$0: unable to find $shlib_version"
    exit 2
d221 3
a223 3
if [ "X$minor" = "X" -o "X$major" = "X" ] ; then
    echo "$0: $shlib_version doesn't contain the version."
    exit 2
d227 4
a230 34
 for instlib in `grep $libname.so "$LIBLIST" ` ; do
    # Grab the major and minor from the installed library.
    instmajor=`basename $instlib | awk 'BEGIN { FS="." } { print $3 } '`
    instminor=`basename $instlib | awk 'BEGIN { FS="." } { print $4 } '`
    instteeny=`basename $instlib | awk 'BEGIN { FS="." } { print $5 + 0 } '`

    # If they're greater than the source, complain.
    if [ "0$major" -eq "0$instmajor" ] ; then
	if [ "0$minor" -eq "0$instminor" ] ; then
	    if [ "0$teeny" -lt "0$instteeny" ] ; then
		if [ $error -eq 0 -a $quiet -eq 0 ]; then
		    echo -n "The following libraries have versions greater"
		    echo " than the source:"
	        fi
		echo $instlib > /dev/stderr
		error=1
	    fi
        elif [ "0$minor" -lt "0$instminor" ] ; then
	    if [ $error -eq 0 -a $quiet -eq 0 ]; then
		echo -n "The following libraries have versions greater"
		echo " than the source:"
	    fi
	    echo $instlib > /dev/stderr
	    error=1
	fi
    elif [ "0$major" -lt "0$instmajor" ] ; then
	if [ $error -eq 0 -a $quiet -eq 0 ] ; then
	    echo -n "The following libraries have versions greater"
	    echo " than the source:"
	fi
	echo $instlib > /dev/stderr
	error=1
    fi
 done
@


1.13.4.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.13 2008/04/30 13:10:50 martin Exp $
a69 1
PROG="$(basename "$0")"
d76 6
a81 9
cat << EOF 1>&2
Usage: $PROG [-q] [-v version_file] -d [installedlibdir [library name]]
       $PROG [-q] [-v version_file] -s [setlistdir [library name]]
       $PROG [-q] [-v version_file] -f liblistfile [library name]
       $PROG is a script that looks for installed libraries with
       versions greater than that in the version file.
       For more information, read the comments.
EOF
	exit 1
d94 28
a121 52
CWD=$(pwd)

fixone() {
	local instmajor=$(basename $1 | awk 'BEGIN { FS="." } { print $3 }')
	local instminor=$(basename $1 | awk 'BEGIN { FS="." } { print $4 }')
	local instteeny=$(basename $1 | awk 'BEGIN { FS="." } { print $5 + 0 }')
	local ms="The following libraries have versions greater than the source"

	# If they're greater than the source, complain.
	if [ "0$major" -eq "0$instmajor" ]; then
		if [ "0$minor" -eq "0$instminor" ]; then
			if [ "0$teeny" -lt "0$instteeny" ]; then
				if [ $error -eq 0 -a $quiet -eq 0 ]; then
					echo "$ms" 1>&2
				fi
				echo $1 1>&2
				error=1
			fi
		elif [ "0$minor" -lt "0$instminor" ]; then
			if [ $error -eq 0 -a $quiet -eq 0 ]; then
				echo "$ms" 1>&2
			fi
			echo $1 1>&2
			error=1
		fi
	elif [ "0$major" -lt "0$instmajor" ]; then
		if [ $error -eq 0 -a $quiet -eq 0 ]; then
			echo "$ms" 1>&2
		fi
		echo $1 1>&2
		error=1
	fi
}

while getopts df:shqv: f; do
	case $f in
	d)	usedir=1 
		if [ $usefile -eq 1 -o $usesets -eq 1 ]; then
			Usage
		fi;;
	f)	usefile=1; arg1=$OPTARG
		if [ $usedir -eq 1 -o $usesets -eq 1 ]; then
			Usage 
		fi;;
	s)	usesets=1 
		if [ $usedir -eq 1 -o $usefile -eq 1 ]; then
			Usage
		fi;;
	v)	shlib_version=$OPTARG;;
	q)	quiet=1;;
	*)	Usage;;
	esac
d124 2
a125 4
shift $(($OPTIND - 1))

if [ $usedir -eq 0 -a $usefile -eq 0 -a $usesets -eq 0 ]; then
	Usage
d128 2
a129 2
if [ $usefile -eq 1 ]; then
	LIBLIST="$arg1"
d131 6
a136 5
	if ! mkdir -m 0700 $TMP; then
		echo "$PROG: Unable to create temp directory." 1>&2
		exit 2
	fi
	LIBLIST=$TMP/libs.lst
d140 7
a146 7
if [ $usedir -eq 1 ]; then
	if [ -n "$1" ]; then
		libdir="$1"
	fi
	for f in $libdir; do
		ls $f/lib*.so.*.*
	done > $LIBLIST 2> /dev/null
d151 5
a155 6
if [ $usesets -eq 1 ]; then
	if [ -n "$1" ]; then
		setsdir="$1"
		if [ -d "$setsdir/distrib/sets/lists" ]; then
			setsdir="$setsdir/distrib/sets/lists"
		fi
d157 5
a161 4
	(cd $setsdir;
	 cat */[a-z]* |
	 grep '^./usr/lib/lib.*\.so\.[0-9][0-9]*\.[0-9][0-9]*' |
	 sort -u > $LIBLIST)
d167 9
a175 8
if [ -z "$2" ]; then
	makefile=$CWD/Makefile
	libname=$(grep '^LIB=' $makefile | sed -e 's/^LIB=[[:space:]]*//')

	# Assume the library name is the name of the current directory.
	if [ -z "$libname" ]; then
		libname=$(basename $CWD)
	fi
d177 1
a177 1
	    libname="$2"
d181 1
a181 1
	libname="lib$libname"
d185 3
a187 3
if [ ! -f $shlib_version ]; then
	echo "$PROG: unable to find $shlib_version" 1>&2
	exit 2
d193 3
a195 3
if [ -z "$minor" -o -z "$major" ]; then
	echo "$PROG: $shlib_version doesn't contain the version." 1>&2
	exit 2
d199 34
a232 4
for instlib in $(grep $libname.so "$LIBLIST"); do
	# Grab the major and minor from the installed library.
	fixone "$instlib"
done
@


1.13.26.1
log
@resync with head
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.13 2008/04/30 13:10:50 martin Exp $
a69 1
PROG="$(basename "$0")"
d76 6
a81 9
cat << EOF 1>&2
Usage: $PROG [-q] [-v version_file] -d [installedlibdir [library name]]
       $PROG [-q] [-v version_file] -s [setlistdir [library name]]
       $PROG [-q] [-v version_file] -f liblistfile [library name]
       $PROG is a script that looks for installed libraries with
       versions greater than that in the version file.
       For more information, read the comments.
EOF
	exit 1
d94 28
a121 52
CWD=$(pwd)

fixone() {
	local instmajor=$(basename $1 | awk 'BEGIN { FS="." } { print $3 }')
	local instminor=$(basename $1 | awk 'BEGIN { FS="." } { print $4 }')
	local instteeny=$(basename $1 | awk 'BEGIN { FS="." } { print $5 + 0 }')
	local ms="The following libraries have versions greater than the source"

	# If they're greater than the source, complain.
	if [ "0$major" -eq "0$instmajor" ]; then
		if [ "0$minor" -eq "0$instminor" ]; then
			if [ "0$teeny" -lt "0$instteeny" ]; then
				if [ $error -eq 0 -a $quiet -eq 0 ]; then
					echo "$ms" 1>&2
				fi
				echo $1 1>&2
				error=1
			fi
		elif [ "0$minor" -lt "0$instminor" ]; then
			if [ $error -eq 0 -a $quiet -eq 0 ]; then
				echo "$ms" 1>&2
			fi
			echo $1 1>&2
			error=1
		fi
	elif [ "0$major" -lt "0$instmajor" ]; then
		if [ $error -eq 0 -a $quiet -eq 0 ]; then
			echo "$ms" 1>&2
		fi
		echo $1 1>&2
		error=1
	fi
}

while getopts df:shqv: f; do
	case $f in
	d)	usedir=1 
		if [ $usefile -eq 1 -o $usesets -eq 1 ]; then
			Usage
		fi;;
	f)	usefile=1; arg1=$OPTARG
		if [ $usedir -eq 1 -o $usesets -eq 1 ]; then
			Usage 
		fi;;
	s)	usesets=1 
		if [ $usedir -eq 1 -o $usefile -eq 1 ]; then
			Usage
		fi;;
	v)	shlib_version=$OPTARG;;
	q)	quiet=1;;
	*)	Usage;;
	esac
d124 2
a125 4
shift $(($OPTIND - 1))

if [ $usedir -eq 0 -a $usefile -eq 0 -a $usesets -eq 0 ]; then
	Usage
d128 2
a129 2
if [ $usefile -eq 1 ]; then
	LIBLIST="$arg1"
d131 6
a136 5
	if ! mkdir -m 0700 $TMP; then
		echo "$PROG: Unable to create temp directory." 1>&2
		exit 2
	fi
	LIBLIST=$TMP/libs.lst
d140 7
a146 7
if [ $usedir -eq 1 ]; then
	if [ -n "$1" ]; then
		libdir="$1"
	fi
	for f in $libdir; do
		ls $f/lib*.so.*.*
	done > $LIBLIST 2> /dev/null
d151 5
a155 6
if [ $usesets -eq 1 ]; then
	if [ -n "$1" ]; then
		setsdir="$1"
		if [ -d "$setsdir/distrib/sets/lists" ]; then
			setsdir="$setsdir/distrib/sets/lists"
		fi
d157 5
a161 4
	(cd $setsdir;
	 cat */[a-z]* |
	 grep '^./usr/lib/lib.*\.so\.[0-9][0-9]*\.[0-9][0-9]*' |
	 sort -u > $LIBLIST)
d167 9
a175 8
if [ -z "$2" ]; then
	makefile=$CWD/Makefile
	libname=$(grep '^LIB=' $makefile | sed -e 's/^LIB=[[:space:]]*//')

	# Assume the library name is the name of the current directory.
	if [ -z "$libname" ]; then
		libname=$(basename $CWD)
	fi
d177 1
a177 1
	    libname="$2"
d181 1
a181 1
	libname="lib$libname"
d185 3
a187 3
if [ ! -f $shlib_version ]; then
	echo "$PROG: unable to find $shlib_version" 1>&2
	exit 2
d193 3
a195 3
if [ -z "$minor" -o -z "$major" ]; then
	echo "$PROG: $shlib_version doesn't contain the version." 1>&2
	exit 2
d199 34
a232 4
for instlib in $(grep $libname.so "$LIBLIST"); do
	# Grab the major and minor from the installed library.
	fixone "$instlib"
done
@


1.12
log
@Ignore (to devnull) errors from ls when no libraries are installed.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.11 2000/07/05 18:56:20 he Exp $
a17 7
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#        This product includes software developed by the NetBSD
#        Foundation, Inc. and its contributors.
# 4. Neither the name of The NetBSD Foundation nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
@


1.12.32.1
log
@sync with head.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.12 2000/07/22 16:04:57 erh Exp $
d18 7
@


1.11
log
@No longer abuse the "minor" number in the shlib_version file to
optionally contain the "teeny" version number.  Instead, introduce
a separate optional "teeny" variable.  This corresponds to the change
in revision 1.171 of share/bsd.lib.mk.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.10 2000/07/03 17:22:20 he Exp $
d153 1
a153 1
    done > $LIBLIST
@


1.10
log
@Pull down revision 1.5.2.1 to the trunk:
Handle use of "tiny" version numbers, to allow version bumps of
shared libraries on a release branch without reusing version numbers.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.9 1999/11/05 20:16:56 erh Exp $
a204 3
tiny=`echo $minor | awk 'BEGIN { FS="." } { print $2 + 0 } '`
minor=`echo $minor | awk 'BEGIN { FS="." } { print $1 } '`

d210 1
a210 1
    insttiny=`basename $instlib | awk 'BEGIN { FS="." } { print $5 + 0 } '`
d215 1
a215 1
	    if [ "0$tiny" -lt "0$insttiny" ] ; then
@


1.9
log
@Add comments describing what this does.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.8 1999/07/02 15:12:15 simonb Exp $
d205 3
d213 1
d217 10
a226 1
	if [ "0$minor" -lt "0$instminor" ] ; then
@


1.9.4.1
log
@Pull up revision 1.10 (requested by he, approved by thorpej):
  Handle use of "tiny" version numbers, to allow version bumps of
  shared libraries on a release branch without reusing version
  numbers.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.9 1999/11/05 20:16:56 erh Exp $
a204 3
tiny=`echo $minor | awk 'BEGIN { FS="." } { print $2 + 0 } '`
minor=`echo $minor | awk 'BEGIN { FS="." } { print $1 } '`

a209 1
    insttiny=`basename $instlib | awk 'BEGIN { FS="." } { print $5 + 0 } '`
d213 1
a213 10
	if [ "0$minor" -eq "0$instminor" ] ; then
	    if [ "0$tiny" -lt "0$insttiny" ] ; then
		if [ $error -eq 0 -a $quiet -eq 0 ]; then
		    echo -n "The following libraries have versions greater"
		    echo " than the source:"
	        fi
		echo $instlib > /dev/stderr
		error=1
	    fi
        elif [ "0$minor" -lt "0$instminor" ] ; then
@


1.9.4.2
log
@pull up rev. 1.11:
No longer abuse the "minor" number in the shlib_version file to
optionally contain the "teeny" version number.  Instead, introduce
a separate optional "teeny" variable.  This corresponds to the change
in revision 1.171 of share/bsd.lib.mk.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.9.4.1 2000/07/03 17:52:57 he Exp $
d205 3
d213 1
a213 1
    instteeny=`basename $instlib | awk 'BEGIN { FS="." } { print $5 + 0 } '`
d218 1
a218 1
	    if [ "0$teeny" -lt "0$instteeny" ] ; then
@


1.8
log
@Remove trailing white space.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.7 1999/06/24 14:39:48 christos Exp $
d40 4
d83 6
a88 3
    echo "Usage: $1 [-q] -d [installedlibdir [library name]]"
    echo "       $1 [-q] -s [setlistdir [library name]]"
    echo "       $1 [-q] -f liblistfile [library name]"
@


1.8.4.1
log
@Pull up to last week's -current.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.9 1999/11/05 20:16:56 erh Exp $
a39 4
# checkver - 
#	Check for libraries that appear to be newer than the
#	one we're about to install.
#
d79 3
a81 6
    echo "Usage: $1 [-q] [-v version_file] -d [installedlibdir [library name]]"
    echo "       $1 [-q] [-v version_file] -s [setlistdir [library name]]"
    echo "       $1 [-q] [-v version_file] -f liblistfile [library name]"
    echo "	$1 is a script that looks for installed libraries with"
    echo "	   versions greater than that in the version file."
    echo "	For more information, read the comments."
@


1.7
log
@portability fix.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.6 1999/06/10 00:32:23 simonb Exp $
d64 1
a64 1
# This script produces no output if all library version are not 
d221 1
a221 1
    fi 
@


1.6
log
@Allow the location of the shlib_version file to specified by the -v
flag.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.5 1999/03/16 18:57:31 christos Exp $
d103 1
a103 1
while . ; do
@


1.5
log
@Make this work on a real bourne shell.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.4 1999/01/27 05:50:29 erh Exp $
d40 3
a42 6
# checkver [-q] -d [installedlibdir [library name]]"
# checkver [-q] -s [setlistdir [library name]]"
# checkver [-q] -f liblistfile [library name]"
#
# This script must be run from a directory in which
# a shlib_version file resides.
d61 3
d87 1
d95 1
a95 1
args=`getopt "df:shq" "$@@"`
d117 1
d185 2
a186 2
if [ ! -f ./shlib_version ] ; then
    echo "$0: unable to find ./shlib_version"
d191 1
a191 1
. ./shlib_version
d194 1
a194 1
    echo "$0: shlib_version doesn't contain the version."
@


1.5.2.1
log
@Apply patch (requested by he):
  Handle use of "tiny" version numbers, to allow version bumps of
  shared libraries on a release branch without reusing version
  numbers.  This paves the way for libc.so.12.40.1.  In order to
  not have to rework bsd.lib.mk, the "minor" version number in the
  shlib_version file will in this example be 40.1, and this script
  tears that apart before comparing.  The tiny version numbers are
  (of course) optional.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.5 1999/03/16 18:57:31 christos Exp $
a195 3
tiny=`echo $minor | awk 'BEGIN { FS="." } { print $2 + 0 } '`
minor=`echo $minor | awk 'BEGIN { FS="." } { print $1 } '`

a200 1
    insttiny=`basename $instlib | awk 'BEGIN { FS="." } { print $5 + 0 } '`
d204 1
a204 10
	if [ "0$minor" -eq "0$instminor" ] ; then
	    if [ "0$tiny" -lt "0$insttiny" ] ; then
		if [ $error -eq 0 -a $quiet -eq 0 ]; then
		    echo -n "The following libraries have versions greater"
		    echo " than the source:"
	        fi
		echo $instlib > /dev/stderr
		error=1
	    fi
        elif [ "0$minor" -lt "0$instminor" ] ; then
@


1.5.2.2
log
@Pull up revision 1.11 (requested by he):
  Introduce the optional "teeny" variable in shlib_version, so that
  we don't abuse the "minor" number to optionally include the
  "teeny" number.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.5.2.1 2000/07/03 17:17:08 he Exp $
d196 3
d204 1
a204 1
    instteeny=`basename $instlib | awk 'BEGIN { FS="." } { print $5 + 0 } '`
d209 1
a209 1
	    if [ "0$teeny" -lt "0$instteeny" ] ; then
@


1.5.2.3
log
@Pull up revision 1.12 (requested by he):
  Output ignorable error messages to /dev/null.
@
text
@d2 1
a2 1
#	$NetBSD: checkver,v 1.5.2.2 2000/07/05 20:49:15 he Exp $
d144 1
a144 1
    done > $LIBLIST 2> /dev/null
@


1.4
log
@Replace find with ls when looking for installed libraries to prevent subdirectories from being searched.  (suggested by Hubert Feyrer)
@
text
@d1 2
a2 2
#!/bin/ksh
#	$NetBSD: checkver,v 1.3 1999/01/27 00:02:55 hubertf Exp $
d73 3
a75 1
trap "exit 2" 1 2 3 4 5 6 7 8 10 11 12 13 14 15
d78 1
a78 1
Usage ( ) {
d129 2
a130 1
   if ! mkdir -m 0700 $TMP ; then
d177 2
a178 1
if ! echo $libname | grep -q "^lib" ; then
@


1.3
log
@add RCS ID
@
text
@d2 1
a2 1
#	$NetBSD$
d139 3
a141 1
    find $libdir -name 'lib*.so.*.*' > $LIBLIST
@


1.2
log
@Add ability to use either a file or the sets files when checking library version numbers.  Added -d, -s and -f flags for check dir, check sets and check file.  Suggested by Simon Burge.
@
text
@d2 1
@


1.1
log
@Add scripts to find any installed libraries whose version is greater than the source version (major, minor).  "checkver" actually does this check.  "checkvers" find all libraries (actually all shlib_version files) below the current directory and runs the checkver script for each one.
@
text
@d39 3
a41 1
# checkver [-q] [installedlibdir [library name]]
d46 1
a46 7
# If no arguments are passed the name of the current directory
# is assumed to be the name of the library.  The directory
# "/usr/lib" will be searched for problematic libraries.
#
# A list of directories of installed libraries may be specified.
# This will replace the default of "/usr/lib" and search there
# instead.
d48 14
a61 2
# An explicit library name may be passed.  If present, checkver
# will use this name when searching the installed libraries.
d71 3
a73 3
trap "exit 1" 1 2 3 4 5 6 7 8 10 11 12 13 14 15

error=0
d76 3
a78 1
    echo "$1 [-q] [installedlibdir [library name]]"
d81 3
d85 8
a92 1
if echo "$*" | egrep -q "[[:space:]]-h[[:space:]]|[[:space:]]--help*" ; then
d97 28
a124 4
if [ "X$1" = "X-q" ] ; then
    # Supress header.
    quiet="1"
    shift
d126 13
a138 1
    quiet="0"
d141 13
a153 4
if [ "X$1" != "X" ] ; then
    LIBDIR="$1"
else
    LIBDIR="/usr/lib"
d156 4
d161 8
a168 5
    # Assume the library name is the
    # name of the current directory.
    libname=`pwd`
    libname=`basename $libname`
 else
d170 4
a173 4
 fi
 if ! echo $libname | grep -q "^lib" ; then
   libname="lib$libname"
 fi
d178 1
a178 1
    exit 1
d182 1
a182 1
 . ./shlib_version
d186 1
a186 1
    exit 1
d190 1
a190 1
 for instlib in `find $LIBDIR -name "$libname.so.*"` ; do
d192 2
a193 2
    instmajor=`echo $instlib | awk 'BEGIN { FS="." } { print $3 } '`
    instminor=`echo $instlib | awk 'BEGIN { FS="." } { print $4 } '`
d198 1
a198 1
	    if [ $error -eq 0 -a $quiet = "0"]; then
d206 1
a206 1
	if [ $error -eq 0 -a $quiet = "0" ] ; then
@
