Subject: pkg/11856: pkg_admin lsbest has flaky pattern matching
To: None <gnats-bugs@gnats.netbsd.org>
From: Dan McMahill (root) <mcmahill@mit.edu>
List: netbsd-bugs
Date: 12/30/2000 16:42:11
>Number:         11856
>Category:       pkg
>Synopsis:       pkg_admin lsbest has flaky pattern matching
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 30 16:42:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     dmcmahill@netbsd.org
>Release:        1.5<NetBSD-current source date>
>Organization:
	
>Environment:
	
System: NetBSD bondage 1.5 NetBSD 1.5 (GENERIC) #10: Wed Nov 22 03:00:56 PST 2000 root@frau-farbissina.shagadelic.org:/amd/swinger/u1/netbsd-1-5/src/sys/arch/alpha/compile/GENERIC alpha


>Description:

pkg_admin lsbest doesn't seem to do so well with expanding patterns.  For example:

the following works correctly:
root@bondage 185 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/png-*"
/usr/packages/netbsd-1.5/alpha/All/png-1.0.8.tgz

but the following seems like it should also find png-1.0.8, but they don't
root@bondage 186 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/png>=1"
root@bondage 187 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/png>=1.0"

however these do:
root@bondage 188 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/png>=0.1"
/usr/packages/netbsd-1.5/alpha/All/png-1.0.8.tgz
root@bondage 189 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/png>=1.0.0"
/usr/packages/netbsd-1.5/alpha/All/png-1.0.8.tgz

I also see problems with "nb[0-9]*" type strings like:
root@bondage 191 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/unproven-pthreads>=0.17"
root@bondage 192 # pkg_admin lsbest "/usr/packages/netbsd-1.5/alpha/All/unproven-pthreads>=0.17nb1"
/usr/packages/netbsd-1.5/alpha/All/unproven-pthreads-0.17nb1.tgz


	
>How-To-Repeat:

touch /tmp/foo-1.0nb1.tgz
pkg_admin lsbest "/tmp/foo>=1.0"

touch /tmp/foo-2.0.3.tgz
pkg_admin lsbest "/tmp/foo>=2.0"

note that a match is not found on either.


	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: