From nobody@FreeBSD.org  Sun Aug 25 18:04:31 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id ACEF837B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Aug 2002 18:04:31 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6DB3C43E42
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Aug 2002 18:04:31 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g7Q14UOT018481
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Aug 2002 18:04:30 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g7Q14U4X018480;
	Sun, 25 Aug 2002 18:04:30 -0700 (PDT)
Message-Id: <200208260104.g7Q14U4X018480@www.freebsd.org>
Date: Sun, 25 Aug 2002 18:04:30 -0700 (PDT)
From: Paul te Bokkel <paul@tebokkel.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pkg_info with PKG_PATH searches through tarred pkgs
X-Send-Pr-Version: www-1.0

>Number:         42018
>Category:       bin
>Synopsis:       pkg_info(1) with PKG_PATH searches through tarred pkgs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 25 18:10:03 PDT 2002
>Closed-Date:    Wed May 28 14:56:51 UTC 2014
>Last-Modified:  Wed May 28 14:56:51 UTC 2014
>Originator:     Paul te Bokkel
>Release:        4.6.2
>Organization:
>Environment:
FreeBSD naya.internal.tebokkel.com 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #1: Sat Aug 24 13:18:25 CEST 2002     root@naya.internal.tebokkel.com:/usr/obj/usr/src/sys/NAYA  i386

>Description:
pkg_info normally searches /var/db/pkg, but if PKG_PATH is set (ie to /usr/ports/packages/All), all tarred (bzip'ped) packages get unpacked to obtain version info. Installed package-info also gets displayed, but not installed packages not (but they seem to be unpacked though).	
>How-To-Repeat:
run pkg_info. See the speed
Make sure packages (preferably some large ones) exist in /usr/ports/packages/All, i.e. using pkg_tarup on X and moving the .tgz's to /All)
export PKG_PATH=/usr/ports/packages/All
run pkg_info. It's slow.
>Fix:
Dunno, didn't look into it since it's low priority and maybe on purpose. Should be documented though.
>Release-Note:
>Audit-Trail:

From: Paul te Bokkel <Paul@tebokkel.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs
Date: Tue, 27 Aug 2002 00:46:16 +0200

 Well.. Decided to look further into it. Fix proposal.
 
 in pkg_install/info/perform.c, line 123 every installed pkg is looked up =
 on
 disk. If a package exists with the same version, that one is used instead=
  of
 the (much faster) /var/db/pkg info. My proposal:
 
 old line 123:  if ((cp =3D fileFindByPath(NULL, pkg)) !=3D NULL)
 
 new line 123:  if ((MatchType !=3D MATCH_ALL) && ((cp =3D fileFindByPath(=
 NULL,
 pkg)) !=3D NULL))
 
 That seems to work for my case and probably for most practical cases.
  However, someone with more experience in pkg-mgmt (I'm rather new to
  FreeBSD) is more qualified to judge about that.
 
 IMHO it would be better to switch the code-logic, i.e. first test if
 /var/db/pkg/<pkgname+ver> exists and if not, then test for an available
 package. That way not-installed packages get skipped, but installed ones =
 get
 looked up by /var/db/pkg. That seems the final fix to me.
 
 I'm not experience enough with C to provide a diff, but if preferred, I c=
 an
 always try.
 
 Paul

From: Paul te Bokkel <Paul@tebokkel.com>
To: freebsd-gnats-submit@FreeBSD.org, paul@tebokkel.com
Cc:  
Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs
Date: Tue, 27 Aug 2002 00:41:41 +0200

 Well.. Decided to look further into it. Fix proposal.
 
 in pkg_install/info/perform.c, line 123 every installed pkg is looked up =
 on=20
 disk. If a package exists with the same version, that one is used instead=
  of=20
 the (much faster) /var/db/pkg info. My proposal:
 
 old line 123:  if ((cp =3D fileFindByPath(NULL, pkg)) !=3D NULL)
 
 new line 123:  if ((MatchType !=3D MATCH_ALL) && ((cp =3D fileFindByPath(=
 NULL,=20
 pkg)) !=3D NULL))
 
 That seems to work for my case and probably for most practical cases. How=
 ever,=20
 someone with more experience in pkg-mgmt (I'm rather new to FreeBSD) is m=
 ore=20
 qualified to judge about that.
 
 IMHO it would be better to switch the code-logic, i.e. first test if=20
 /var/db/pkg/<pkgname+ver> exists and if not, then test for an available=20
 package. That way not-installed packages get skipped, but installed ones =
 get=20
 looked up by /var/db/pkg. That seems the final fix to me.
 
 I'm not experience enough with C to provide a diff, but if preferred, I c=
 an=20
 always try.
 
 Paul

From: Paul te Bokkel <Paul@tebokkel.com>
To: freebsd-gnats-submit@FreeBSD.org, paul@tebokkel.com
Cc:  
Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs
Date: Tue, 27 Aug 2002 01:19:54 +0200

 Well.. Decided to look further into it. Fix proposal.
 
 in pkg_install/info/perform.c, line 123 every installed pkg is looked up =
 on=20
 disk. If a package exists with the same version, that one is used instead=
  of=20
 the (much faster) /var/db/pkg info. My proposal:
 
 old line 123:  if ((cp =3D fileFindByPath(NULL, pkg)) !=3D NULL)
 
 new line 123:  if ((MatchType !=3D MATCH_ALL) && ((cp =3D fileFindByPath(=
 NULL,=20
 pkg)) !=3D NULL))
 
 That seems to work for my case and probably for most practical cases. How=
 ever,=20
 someone with more experience in pkg-mgmt (I'm rather new to FreeBSD) is m=
 ore=20
 qualified to judge about that.
 
 IMHO it would be better to switch the code-logic, i.e. first test if=20
 /var/db/pkg/<pkgname+ver> exists and if not, then test for an available=20
 package. That way not-installed packages get skipped, but installed ones =
 get=20
 looked up by /var/db/pkg. That seems the final fix to me.
 
 I'm not experience enough with C to provide a diff, but if preferred, I c=
 an=20
 always try.
 
 Paul

From: Paul te Bokkel <Paul@tebokkel.com>
To: freebsd-gnats-submit@FreeBSD.org, paul@tebokkel.com
Cc:  
Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs
Date: Tue, 27 Aug 2002 22:12:23 +0200

 Err... sorry.. while fixing my masquerade-as, I forgot the mailqueue and=20
 resend the follow-up two times..

From: Mark Linimon <linimon@lonesome.com>
To: freebsd-gnats-submit@FreeBSD.org, paul@tebokkel.com
Cc:  
Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs
Date: Wed, 05 Nov 2003 01:58:59 +0000

 Is this PR about the pkg_info that's in the base system (/usr/sbin)?
 Or is it about one of the ports?
 

From: Paul te Bokkel <paul@tebokkel.com>
To: Mark Linimon <linimon@lonesome.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs
Date: Sat, 8 Nov 2003 01:02:44 +0100

 Hi,
 
 It's not about a specific port, it's about the base system pkg_info. I
 haven't checked for a while now. It was current as of date of entry.
 
 Regards,
 
 Paul
 
 On Wed, Nov 05, 2003 at 01:58:59AM +0000, Mark Linimon wrote:
 > Is this PR about the pkg_info that's in the base system (/usr/sbin)?
 > Or is it about one of the ports?
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jan 24 10:41:17 PST 2004 
Responsible-Changed-Why:  
According to the latest information from the submitter, this 
is about the base system, so it should be in bin, not ports. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42018 
Responsible-Changed-From-To: freebsd-bugs->krion 
Responsible-Changed-By: flz 
Responsible-Changed-When: Fri Aug 19 12:39:52 GMT 2005 
Responsible-Changed-Why:  
Bug krion with pkg_install PRs. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42018 
Responsible-Changed-From-To: krion->portmgr 
Responsible-Changed-By: flz 
Responsible-Changed-When: Fri Jul 17 13:42:32 UTC 2009 
Responsible-Changed-Why:  
pkg_install is maintained by portmgr. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42018 
State-Changed-From-To: open->closed 
State-Changed-By: bapt 
State-Changed-When: Wed May 28 14:56:50 UTC 2014 
State-Changed-Why:  
pkg_install is not being worked on anymore 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42018 
>Unformatted:
