mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-08 06:48:28 +00:00
- Remove two checks obviated by the removal of _OPTIONSFILE in revision 1.596 [1]
- Remove Legacy USE_BISON in bsd.port.mk [2] - Remove Legacy 2004 Hack in bsd.port.mk [3] - CONFLICT handling in has been reworked. There are two new variables in bsd.ports.mk: - CONFLICTS_BUILDS: Check for conflicts prior to build - CONFLICTS_INSTALL: Check for conflicts prior to installation stage The existing CONFLICTS checks for conflicts prior to build and installation stage. Users could defer the conflict check of CONFLICTS_BUILDS and CONFLICTS to the installation stage by using DEFER_CONFLICTS_CHECK. As already possible with CONFLICTS the new conflict checks could be disabled by using DISABLE_CONFLICTS. This patch was submitted by beat@ PR: ports/149670 [1] ports/151806 [2] [3] Subitted by: bf <bf1783@gmail.com> [1] Eitan Adler <lists@eitanadler.com> [2] [3]
This commit is contained in:
parent
6121c39e60
commit
da9e8a04fa
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=265503
144
Mk/bsd.port.mk
144
Mk/bsd.port.mk
@ -371,8 +371,7 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
|
||||
# should not be used in Makefile.
|
||||
##
|
||||
# USE_BISON - Implies that the port uses bison in one way or another:
|
||||
# 'yes' (backwards compatibility) - use bison for building
|
||||
# new features: 'build', 'run', 'both', implying build,
|
||||
# 'build', 'run', 'both', implying build,
|
||||
# runtime, and both build/run dependencies
|
||||
##
|
||||
# USE_IMAKE - If set, this port uses imake.
|
||||
@ -551,6 +550,12 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
|
||||
# pattern meta-characters "*", "?", "[", "]", and "!".
|
||||
# Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
|
||||
#
|
||||
# CONFLICTS_BUILD
|
||||
# - Check conflict prior to the build.
|
||||
#
|
||||
# CONFLICTS_INSTALL
|
||||
# - Check conflict prior to the installation stage.
|
||||
#
|
||||
# Various directory definitions and variables to control them.
|
||||
# You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
|
||||
#
|
||||
@ -2040,13 +2045,6 @@ RUN_DEPENDS+= ${_GL_${_component}_RUN_DEPENDS}
|
||||
.if defined(USE_BISON)
|
||||
_BISON_DEPENDS= bison:${PORTSDIR}/devel/bison
|
||||
|
||||
# XXX: backwards compatibility
|
||||
. if ${USE_BISON:L} == "yes"
|
||||
USE_BISON= build
|
||||
pre-everything::
|
||||
@${ECHO_MSG} "WARNING: USE_BISON=yes deprecated, use build/run/both"
|
||||
. endif
|
||||
|
||||
. if ${USE_BISON:L} == "build"
|
||||
BUILD_DEPENDS+= ${_BISON_DEPENDS}
|
||||
. elif ${USE_BISON:L} == "run"
|
||||
@ -2501,6 +2499,12 @@ PKG_ARGS+= -o ${PKGORIGIN}
|
||||
.if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
|
||||
PKG_ARGS+= -C "${CONFLICTS}"
|
||||
.endif
|
||||
.if defined(CONFLICTS_BUILD) && !defined(DISABLE_CONFLICTS)
|
||||
PKG_ARGS+= -C "${CONFLICTS_BUILD}"
|
||||
.endif
|
||||
.if defined(CONFLICTS_INSTALL) && !defined(DISABLE_CONFLICTS)
|
||||
PKG_ARGS+= -C "${CONFLICTS_INSTALL}"
|
||||
.endif
|
||||
.endif
|
||||
.if defined(PKG_NOCOMPRESS)
|
||||
PKG_SUFX?= .tar
|
||||
@ -3077,12 +3081,8 @@ check-makevars::
|
||||
@${FALSE}
|
||||
.endif
|
||||
_MLINKS= ${_MLINKS_PREPEND}
|
||||
# XXX 20040119 This next line should read:
|
||||
# .for lang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
|
||||
# but there is currently a bug in make(1) that prevents the double-quote
|
||||
# substitution from working correctly. Once that problem is addressed,
|
||||
# and has had a enough time to mature, this hack should be removed.
|
||||
.for lang in ${MANLANG:S%^%man/%:S%^man/""$%man%:S%^man/"$%man%}
|
||||
|
||||
.for lang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
|
||||
.for ___pmlinks in ${__pmlinks}
|
||||
.for __lang in ${lang}
|
||||
_MLINKS+= ${___pmlinks:S// /g}
|
||||
@ -3100,12 +3100,7 @@ _COUNT=1
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
# XXX 20040119 This next line should read:
|
||||
# .for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
|
||||
# but there is currently a bug in make(1) that prevents the double-quote
|
||||
# substitution from working correctly. Once that problem is addressed,
|
||||
# and has had a enough time to mature, this hack should be removed.
|
||||
.for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%:S%^man/"$%man%}
|
||||
.for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
|
||||
|
||||
.for sect in 1 2 3 4 5 6 7 8 9 L N
|
||||
# MAN${sect} is for man pages installed for all languages in MANLANG for a given
|
||||
@ -3464,9 +3459,6 @@ options-message:
|
||||
.endif
|
||||
.if defined(_OPTIONS_READ)
|
||||
@${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
|
||||
.if ${OPTIONSFILE} != ${OPTIONSFILE}
|
||||
@${ECHO_MSG} "===> *** CAUTION *** Using wrong configuration file ${OPTIONSFILE}"
|
||||
.endif
|
||||
.endif
|
||||
|
||||
|
||||
@ -3826,9 +3818,92 @@ do-build:
|
||||
# Check conflicts
|
||||
|
||||
.if !target(check-conflicts)
|
||||
check-conflicts:
|
||||
.if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
|
||||
@found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
|
||||
check-conflicts: check-build-conflicts check-install-conflicts
|
||||
.endif
|
||||
|
||||
.if !target(check-build-conflicts)
|
||||
check-build-conflicts:
|
||||
.if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK)
|
||||
@found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
|
||||
conflicts_with=; \
|
||||
for entry in $${found}; do \
|
||||
if ${PKG_INFO} -e $${entry} ; then \
|
||||
prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
|
||||
orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
|
||||
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
||||
conflicts_with="$${conflicts_with} $${entry}"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ -n "$${conflicts_with}" ]; then \
|
||||
${ECHO_MSG}; \
|
||||
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
||||
for entry in $${conflicts_with}; do \
|
||||
${ECHO_MSG} " $${entry}"; \
|
||||
done; \
|
||||
${ECHO_MSG}; \
|
||||
${ECHO_MSG} " They will not build together."; \
|
||||
${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
|
||||
exit 1; \
|
||||
fi
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if !target(identify-install-conflicts)
|
||||
identify-install-conflicts:
|
||||
.if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS)
|
||||
@found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
|
||||
conflicts_with=; \
|
||||
for entry in $${found}; do \
|
||||
if ${PKG_INFO} -e $${entry} ; then \
|
||||
prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
|
||||
orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
|
||||
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
||||
conflicts_with="$${conflicts_with} $${entry}"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ -n "$${conflicts_with}" ]; then \
|
||||
${ECHO_MSG}; \
|
||||
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
||||
for entry in $${conflicts_with}; do \
|
||||
${ECHO_MSG} " $${entry}"; \
|
||||
done; \
|
||||
${ECHO_MSG}; \
|
||||
${ECHO_MSG} " They install files into the same place."; \
|
||||
${ECHO_MSG} " You may want to stop build with Ctrl + C."; \
|
||||
sleep 10; \
|
||||
fi
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if !target(check-install-conflicts)
|
||||
check-install-conflicts:
|
||||
.if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS)
|
||||
.if defined(DEFER_CONFLICTS_CHECK)
|
||||
@found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
|
||||
conflicts_with=; \
|
||||
for entry in $${found}; do \
|
||||
if ${PKG_INFO} -e $${entry} ; then \
|
||||
prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
|
||||
orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
|
||||
if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
|
||||
conflicts_with="$${conflicts_with} $${entry}"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
if [ -n "$${conflicts_with}" ]; then \
|
||||
${ECHO_MSG}; \
|
||||
${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
|
||||
for entry in $${conflicts_with}; do \
|
||||
${ECHO_MSG} " $${entry}"; \
|
||||
done; \
|
||||
${ECHO_MSG}; \
|
||||
${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
|
||||
exit 1; \
|
||||
fi
|
||||
.else
|
||||
@found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
|
||||
conflicts_with=; \
|
||||
for entry in $${found}; do \
|
||||
if ${PKG_INFO} -e $${entry} ; then \
|
||||
@ -3850,7 +3925,8 @@ check-conflicts:
|
||||
${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
|
||||
exit 1; \
|
||||
fi
|
||||
.endif # CONFLICTS
|
||||
.endif # defined(DEFER_CONFLICTS_CHECK)
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# Install
|
||||
@ -4324,15 +4400,15 @@ _CHROOT_SEQ=
|
||||
.endif
|
||||
_SANITY_SEQ= ${_CHROOT_SEQ} pre-everything check-makefile \
|
||||
check-categories check-makevars check-desktop-entries \
|
||||
check-conflicts check-depends check-deprecated \
|
||||
check-depends identify-install-conflicts check-deprecated \
|
||||
check-vulnerable check-license buildanyway-message \
|
||||
options-message
|
||||
_FETCH_DEP= check-sanity
|
||||
_FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
|
||||
do-fetch post-fetch post-fetch-script
|
||||
_EXTRACT_DEP= fetch
|
||||
_EXTRACT_SEQ= extract-message checksum extract-depends pre-extract \
|
||||
pre-extract-script do-extract \
|
||||
_EXTRACT_SEQ= check-build-conflicts extract-message checksum extract-depends \
|
||||
pre-extract pre-extract-script do-extract \
|
||||
post-extract post-extract-script
|
||||
_PATCH_DEP= extract
|
||||
_PATCH_SEQ= ask-license patch-message patch-depends patch-dos2unix pre-patch \
|
||||
@ -4345,7 +4421,7 @@ _BUILD_DEP= configure
|
||||
_BUILD_SEQ= build-message pre-build pre-build-script do-build \
|
||||
post-build post-build-script
|
||||
_INSTALL_DEP= build
|
||||
_INSTALL_SEQ= install-message run-depends lib-depends apply-slist pre-install \
|
||||
_INSTALL_SEQ= install-message check-install-conflicts run-depends lib-depends apply-slist pre-install \
|
||||
pre-install-script generate-plist check-already-installed
|
||||
_INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
|
||||
pre-su-install-script create-users-groups do-install \
|
||||
@ -5992,10 +6068,6 @@ config:
|
||||
.if !defined(OPTIONS)
|
||||
@${ECHO_MSG} "===> No options to configure"
|
||||
.else
|
||||
.if ${OPTIONSFILE} != ${OPTIONSFILE}
|
||||
@${ECHO_MSG} "===> Using wrong configuration file ${OPTIONSFILE}"
|
||||
@exit 1
|
||||
.endif
|
||||
.if ${UID} != 0 && !defined(INSTALL_AS_USER)
|
||||
@optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
|
||||
${ECHO_MSG} "===> Switching to root credentials to create $${optionsdir}"; \
|
||||
|
Loading…
Reference in New Issue
Block a user