which needed to be set at compile time but weren't (to handle the case where
TAR_CMD was set to something other than "tar", eg "gtar". In addition to
the constants being wrong, the wrong directory name was being examined for
its string length.
Add a few comments to hopefully avoid having this problem come back.
a bit, to make them more descriptive
* in findbestmatchingname_fn, fix a bug where a null pointer wasn't
caught (I wonder why we didn't actually hit that case...)
* Bugfix in findbestmatchingname_fn: when comparing, strip off any
trailing ".tgz", as this will give wrong results. "1.9.8.tgz" was
found to be greater than "1.9.8.1".
package matching a certain pattern. Examples:
yui# cd /usr/pkgsrc/packages/i386ELF/All/
yui# ls unzip*
unzip-5.40.tgz unzip-5.41.tgz
yui# pkg_admin lsall 'unzip*'
unzip-5.40.tgz
unzip-5.41.tgz
yui# pkg_admin lsall 'unzip>=5.40'
unzip-5.40.tgz
unzip-5.41.tgz
yui# pkg_admin lsall 'unzip>=5.41'
unzip-5.41.tgz
yui# pkg_admin lsbest 'unzip>=5.40'
unzip-5.41.tgz
yui# pkg_admin lsall /usr/pkgsrc/packages/i386ELF/All/'{mit,unproven}-pthread*'
/usr/pkgsrc/packages/i386ELF/All/mit-pthreads-1.60b6.tgz
This adds a shell/user-interface to pkg-patterns, which are a superset
of sh/csh patterns and can't be expanded by any shell.
Handling all kinds of wildcards properly would be hard, though it should
handle some cases better now. Esp. ones with '-' in the pkg(!) name, and/or
ones with dewer relational versions. I.e. the teTeX-share>1.97 case should
work now.
after a "-" with the "more liberal pattern", but also anything after
any pkg wildcard.
That way if someone has teTeX-share-1.0 installed and pkg_adds
teTeX-1.0.7 (which wants teTeX-share>1.0.2), it will be caught.
XXX This "quick depends pre-check" would be nice to be done in
bsd.pkg.mk as well
dependencies if they _can_ be installed. I.e. if a package wants
version X installed, but version Y is already installed, pkg_adding
that required pkg will blow up later (probably some pkg_add recursions
down, given what we keep in the depends list). Now, it stopps right
away:
noon# pkg_add /usr/pkgsrc/packages/i386ELF/All/xdaemon-1.0.tgz
pkg_add: pkg `xteddy-1.*' required, but `xteddy-2.0.1' found installed.
Please resolve this conflict!
The idea of this is from Thomas Klausner, further inputs from Alistair
Crooks.
* allow pkg names without versions given to "pkg_admin check"
* Use sizeof() instead of hardcoding the buffers' size in some places
Modulo some code cleanup, this gives NetBSD full wildcard support not
only in pkgsrc, but esp. for binary packages installed from local disk
and via FTP. For more information, see:
http://www.feyrer.de/NetBSD/wildcards.html