Patch below adds support of a BUILD_BROKES_WHEN_INSTALLED variable. If
this variable is set, port's building process will be prohibited if some
version of port is already installed. Glib2 is a good example of a port
needs such prohibition.
No manpage changes yet, I want to get response for the idea first.
--
Best wishes,
Vadim Zhukov
--- bsd.port.mk 12 Apr 2008 13:04:21 -0000 1.926
+++ bsd.port.mk 25 Apr 2008 13:24:52 -0000
@@ -80,7 +80,7 @@
_ALL_VARIABLES ?= HOMEPAGE DISTNAME BUILD_DEPENDS RUN_DEPENDS \
REGRESS_DEPENDS USE_GMAKE MODULES FLAVORS \
NO_BUILD NO_REGRESS SHARED_ONLY ONLY_FOR_ARCHS IS_INTERACTIVE \
- BROKEN MULTI_PACKAGES PSEUDO_FLAVORS \
+ BROKEN BUILD_BROKES_WHEN_INSTALLED MULTI_PACKAGES PSEUDO_FLAVORS \
REGRESS_IS_INTERACTIVE DISTFILES DIST_SUBDIR \
PERMIT_DISTFILES_CDROM PERMIT_DISTFILES_FTP \
CONFIGURE_STYLE USE_LIBTOOL SEPARATE_BUILD \
@@ -259,6 +259,7 @@
SHARED_ONLY ?= No
SEPARATE_BUILD ?= No
+BUILD_BROKES_WHEN_INSTALLED ?= No
DIST_SUBDIR ?=
@@ -2096,6 +2097,18 @@
${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE}
.if ${NO_BUILD:L} == "no"
@${ECHO_MSG} "===> Building for ${FULLPKGNAME}${_MASTER}"
+.if ${BUILD_BROKES_WHEN_INSTALLED:L} == "yes"
+.for S in ${MULTI_PACKAGES}
+ @if
INSTALLED_VERSIONS="`${_PKG_QUERY} '${FULLPKGNAME${S}:C/-[0-9].*//g}-*'`";
then \
+ echo ""; \
+ echo "*** Making this port brokes when another version is
installed.";
\
+ echo "*** Please, uninstall corresponding package(-s) first:"; \
+ echo "*** $$INSTALLED_VERSIONS"; \
+ echo ""; \
+ false; \
+ else true; fi
+.endfor
+.endif
.if ${VMEM_WARNING:L} == "yes"
@echo ""; \
echo "*** WARNING: you may see an error such as"; \