- Add USE_PACKAGE_DEPENDS_ONLY which will try installing dependencies

from existing packages and not fallback on building from source.

  This is useful for package building tools such as poudriere and tinderbox
  to avoid building from source and confusing the build log, if a dependency
  failed to build for some reason.

  NOTE: USE_PACKAGE_DEPENDS has not changed here. It has always
        reverted to source if the package was not present.

PR:		ports/180725
Submitted by:	crees
With hat:	portmgr
This commit is contained in:
Bryan Drewery 2013-08-31 13:56:08 +00:00
parent 6bad5fa85f
commit 954b650462
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=325807
2 changed files with 17 additions and 3 deletions

View File

@ -10,6 +10,13 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
20130831:
AUTHOR: bdrewery@FreeBSD.org
crees has added USE_PACKAGE_DEPENDS_ONLY which works like
USE_PACKAGE_DEPENDS but will not fallback on source if a
package is missing.
20130731:
AUTHOR: bapt@FreeBSD.org

View File

@ -1084,8 +1084,11 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# a different checksum and you intend to verify if
# the port still works with it.
# USE_PACKAGE_DEPENDS
# - Install dependencies from existing packages instead
# of building the port from scratch.
# - Try to install dependencies from existing packages instead
# of building the port from scratch. Fallback on source
# if an existing package is not present.
# USE_PACKAGE_DEPENDS_ONLY
# - Like USE_PACKAGE_DEPENDS, but do not fallback on source.
# INSTALL_AS_USER
# - Define this to install as the current user, intended
# for systems where you have no root access.
@ -4906,7 +4909,7 @@ _DEPEND_ALWAYS= 0
.endif
_INSTALL_DEPENDS= \
if [ X${USE_PACKAGE_DEPENDS} != "X" ]; then \
if [ -n "${USE_PACKAGE_DEPENDS}" -o -n "${USE_PACKAGE_DEPENDS_ONLY}" ]; then \
subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
subpkgname=$${subpkgfile%-*} ; \
subpkgname=$${subpkgname\#\#*/} ; \
@ -4920,6 +4923,10 @@ _INSTALL_DEPENDS= \
else \
${PKG_ADD} $${subpkgfile}; \
fi; \
elif [ -n "${USE_PACKAGE_DEPENDS_ONLY}" ]; then \
${ECHO_MSG} "===> ${PKGNAME} depends on package: $${subpkgfile} - not found"; \
${ECHO_MSG} "===> USE_PACKAGE_DEPENDS_ONLY set - will not build from source"; \
exit 1; \
else \
(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
fi; \