Subject: pkg/8597: pkg/make show-downlevel
To: None <gnats-bugs@gnats.netbsd.org>
From: None <wiz@danbala.ifoer.tuwien.ac.at>
List: netbsd-bugs
Date: 10/09/1999 20:43:40
>Number:         8597
>Category:       pkg
>Synopsis:       pkg/make show-downlevel reports bogus downlevels
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct  9 20:42:01 1999
>Last-Modified:
>Originator:     Wiz
>Organization:
	
>Release:        NetBSD-1.4.1/i386, pkgsrc sup from October 9th
>Environment:
	
System: NetBSD hiro.xon.net 1.4.1 NetBSD 1.4.1 (HIRO) #0: Tue Sep 14 19:22:33 CEST 1999 wiz@hiro.xon.net:/usr/src/sys/arch/i386/compile/HIRO i386


>Description:
make show-downlevel reports bogus down-levels, e.g. for teTeX against itself
and its parts, or for lame against lame-gui, or for xpdf against xpdf-crypto.

>How-To-Repeat:
cd /usr/pkgsrc/audio/lame-gui
make install
cd ../lame
make show-downlevel

reports

lame package: lame-gui-3.31beta installed, pkgsrc version lame-3.31beta

Or, even better, try:
cd /usr/pkgsrc/print/teTeX
make install
make show-downlevel

reports

teTeX package: teTeX-1.0.6
teTeX-share-1.0
teTeX-bin-1.0.6
teTeX-sharesrc-1.0 installed, pkgsrc version teTeX-1.0.6

It also works for /usr/pkgsrc/graphics/xpdf when
/usr/pkgsrc/graphics/xpdf-crypto is installed.
>Fix:
In /usr/pkgsrc/mk/bsd.pkg.mk, in the show-downlevel target,
line 1000 in v1.353, replacing
        found=`${PKG_INFO} -e "$$base-*" || ${TRUE}`;                   \
with
        found=`${PKG_INFO} -e "$$base-[0-9.]*" || ${TRUE}`;             \
seems to do the trick. I don't really understand pkg_info's -e option,
but I tried the following:
wiz@hiro:/usr/pkgsrc/mk> pkg_info -e lame-[0-9.]*
wiz@hiro:/usr/pkgsrc/mk> pkg_info -e lame-gui-[0-9.]*
lame-gui-3.31beta
wiz@hiro:/usr/pkgsrc/mk>

So it should work at least for the programs whose version number starts
with a digit or a dot (are there any that don't do this?).
>Audit-Trail:
>Unformatted: