Recent bsd.port.mk changes

Kris Kennaway kris at obsecurity.org
Tue Apr 22 12:33:39 PDT 2003


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 
> guess it's looks better than a first one.
> 
> --- 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`" != 
> "x" ]; then \
> +    @found_pkgs=`${PKG_INFO} -q -O ${PKGORIGIN} 2> /dev/null | ${SED} 
> -e 's#\(.*\)-.*$$#\1#'`; \
> +    for i in $${found_pkgs}; do \
> +	   if [ "$$i" = "${PKGBASE}" ]; then found=1; 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20030422/b4f2e6d6/attachment.bin


More information about the freebsd-ports mailing list