From owner-freebsd-ports Mon Aug 26 16:20:34 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 EB0E737B401 for ; Mon, 26 Aug 2002 16:20:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C64543E3B for ; Mon, 26 Aug 2002 16:20:06 -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 g7QNK6JU046316 for ; Mon, 26 Aug 2002 16:20:06 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7QNK6aV046315; Mon, 26 Aug 2002 16:20:06 -0700 (PDT) Date: Mon, 26 Aug 2002 16:20:06 -0700 (PDT) Message-Id: <200208262320.g7QNK6aV046315@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 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/ 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message