From owner-freebsd-ports Mon Aug 26 16:20:54 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 481E437B4A4 for ; Mon, 26 Aug 2002 16:20:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3C0E43E42 for ; Mon, 26 Aug 2002 16:20:10 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7QNKAJU046330 for ; Mon, 26 Aug 2002 16:20:10 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7QNKA5E046329; Mon, 26 Aug 2002 16:20:10 -0700 (PDT) Date: Mon, 26 Aug 2002 16:20:10 -0700 (PDT) Message-Id: <200208262320.g7QNKA5E046329@freefall.freebsd.org> To: freebsd-ports@FreeBSD.org Cc: From: Paul te Bokkel Subject: Re: ports/42018: pkg_info with PKG_PATH searches through tarred pkgs Reply-To: Paul te Bokkel Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR ports/42018; it has been noted by GNATS. From: Paul te Bokkel 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/ 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message