From owner-freebsd-ports@FreeBSD.ORG Tue Apr 22 12:33:38 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E70ED37B401 for ; Tue, 22 Apr 2003 12:33:38 -0700 (PDT) Received: from obsecurity.dyndns.org (adsl-67-115-75-1.dsl.lsan03.pacbell.net [67.115.75.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id E005943F85 for ; Tue, 22 Apr 2003 12:33:37 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: from rot13.obsecurity.org (rot13.obsecurity.org [10.0.0.5]) by obsecurity.dyndns.org (Postfix) with ESMTP id 7655466D6A; Tue, 22 Apr 2003 12:33:37 -0700 (PDT) Received: by rot13.obsecurity.org (Postfix, from userid 1000) id 57CE31532; Tue, 22 Apr 2003 12:33:37 -0700 (PDT) Date: Tue, 22 Apr 2003 12:33:37 -0700 From: Kris Kennaway To: Sergey Matveychuk Message-ID: <20030422193337.GA64963@rot13.obsecurity.org> References: <000501c3074c$e5c2be80$0a2da8c0@sem> <20030421210257.GA58574@rot13.obsecurity.org> <3EA48724.3080602@ciam.ru> <20030422001917.GA60080@rot13.obsecurity.org> <3EA53B4A.4030700@ciam.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: <3EA53B4A.4030700@ciam.ru> User-Agent: Mutt/1.4i cc: ports@freebsd.org cc: Kris Kennaway Subject: Re: Recent bsd.port.mk changes X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 19:33:39 -0000 --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 22, 2003 at 04:53:30PM +0400, Sergey Matveychuk wrote: > Here is a patch. Take a look. I'v added deinstall target there too. I=20 > guess it's looks better than a first one. >=20 > --- bsd.port.mk.orig Wed Apr 9 12:37:24 2003 > +++ bsd.port.mk Tue Apr 22 04:34:33 2003 > @@ -2894,8 +2894,11 @@ > .if !target(check-already-installed) > check-already-installed: > .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER) > - @if [ -d ${PKG_DBDIR}/${PKGNAME} -o \ > - "x`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null`" !=3D=20 > "x" ]; then \ > + @found_pkgs=3D`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null | ${SED}= =20 > -e 's#\(.*\)-.*$$#\1#'`; \ > + for i in $${found_pkgs}; do \ > + if [ "$$i" =3D "${PKGBASE}" ]; then found=3D1; break; fi \ I think this check is too restrictive now (i.e. it will install when a version is already installed, in certain cases). Ports with different names can still refer to the same port, e.g. when a port is renamed (without being moved to a new origin) or rebuilt with different features enabled ("foo-1.2.3" vs "foo-esound-1.2.3" etc.) This is why I suggested that comparing the installation prefix and pkg-plist for overlap with ports that have the same origin may be the only way to do this reliably. To further complicate matters, ports that are moved from one location to another (listed in MOVED, which can be machine-parsed) are also the same package, even though they have different origins. Kris --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+pZkQWry0BWjoQKURAo/PAKC5xBuqL/uwoGldBizHQFx4I8xsWQCfbNG1 0vVhcw4FS28fSXtDJeUig7Y= =C2nu -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF--