Date: Tue, 22 Apr 2003 12:33:37 -0700 From: Kris Kennaway <kris@obsecurity.org> To: Sergey Matveychuk <sem@ciam.ru> Cc: Kris Kennaway <kris@obsecurity.org> Subject: Re: Recent bsd.port.mk changes Message-ID: <20030422193337.GA64963@rot13.obsecurity.org> In-Reply-To: <3EA53B4A.4030700@ciam.ru> References: <000501c3074c$e5c2be80$0a2da8c0@sem> <20030421210257.GA58574@rot13.obsecurity.org> <3EA48724.3080602@ciam.ru> <20030422001917.GA60080@rot13.obsecurity.org> <3EA53B4A.4030700@ciam.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030422193337.GA64963>