On Sat, Nov 19, 2016 at 11:43:30AM -0800, Eric Pruitt wrote:
> On Sun, Oct 23, 2016 at 04:28:04PM -0700, Eric Pruitt wrote:
> > >Description:
> > When running pkg_info -I with a version spec, the version of
> > each entry matching the query is overwritten with the query
> > itself.
> >
> > >How-To-Repeat:
> > This is what I get:
> >
> > $ pkg_info -I 'automake-<1.10'
> > automake-<1.10 GNU Standards-compliant Makefile generator
> > automake-<1.10 GNU Standards-compliant Makefile generator
> > automake-<1.10 GNU Standards-compliant Makefile generator
> >
> > This is what I expected:
> >
> > $ pkg_info -I 'automake-<1.10'
> > automake-1.4.6p4 GNU Standards-compliant Makefile generator
> > automake-1.8.5p8 GNU Standards-compliant Makefile generator
> > automake-1.9.6p11 GNU Standards-compliant Makefile generator
>
> This also happens on OpenBSD 6.0 which I didn't realize had been
> released when I originally submitted this report.
>
> Eric
Fun one. This patch should fix it.
Index: OpenBSD/PkgInfo.pm
===================================================================
RCS file: /build/data/openbsd/cvs/src/usr.sbin/pkg_add/OpenBSD/PkgInfo.pm,v
retrieving revision 1.43
diff -u -p -r1.43 PkgInfo.pm
--- OpenBSD/PkgInfo.pm 4 Oct 2016 10:10:19 -0000 1.43
+++ OpenBSD/PkgInfo.pm 24 Nov 2016 15:30:35 -0000
@@ -212,7 +212,7 @@ sub find_pkg_in
return 0;
} else {
for my $pkg (@$r) {
- &$code($pkgname, $pkg);
+ &$code($pkg->name, $pkg);
$pkg->close_now;
$pkg->wipe_info;
}