FreeBSD Bugzilla – Attachment 164242 Details for
Bug 198881
[patch] Add two new special behavior variables: USE_REPO_DEPENDS and USE_REPO_DEPENDS_ONLY
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patcch v2.0.1
mk.diff (text/plain), 4.87 KB, created by
David Naylor
on 2015-12-14 19:35:01 UTC
(
hide
)
Description:
Patcch v2.0.1
Filename:
MIME Type:
Creator:
David Naylor
Created:
2015-12-14 19:35:01 UTC
Size:
4.87 KB
patch
obsolete
>diff --git a/Mk/Scripts/do-depends.sh b/Mk/Scripts/do-depends.sh >index 4bbddcc..127e7a5 100644 >--- a/Mk/Scripts/do-depends.sh >+++ b/Mk/Scripts/do-depends.sh >@@ -11,41 +11,61 @@ validate_env dp_RAWDEPENDS dp_DEPTYPE dp_DEPENDS_TARGET dp_DEPENDS_PRECLEAN \ > dp_DEPENDS_CLEAN dp_DEPENDS_ARGS dp_USE_PACKAGE_DEPENDS \ > dp_USE_PACKAGE_DEPENDS_ONLY dp_PKG_ADD dp_PKG_INFO dp_WRKDIR \ > dp_PKGNAME dp_STRICT_DEPENDS dp_LOCALBASE dp_LIB_DIRS dp_SH \ >- dp_SCRIPTSDIR PORTSDIR dp_MAKE >+ dp_SCRIPTSDIR PORTSDIR dp_MAKE dp_USE_REPO_DEPENDS \ >+ dp_USE_REPO_DEPENDS_ONLY dp_PKG_INSTALL > > set -u > > install_depends() > { >- origin=$1 >- target=$2 >- depends_args=$3 >- if [ -z "${dp_USE_PACKAGE_DEPENDS}" -a -z "${dp_USE_PACKAGE_DEPENDS_ONLY}" ]; then >- ${dp_MAKE} -C ${origin} -DINSTALLS_DEPENDS ${target} ${depends_args} >- return 0 >- fi >+ local origin=$1 >+ local target=$2 >+ local depends_args=$3 >+ >+ local no_source="${dp_USE_PACKAGE_DEPENDS_ONLY}${dp_USE_REPO_DEPENDS_ONLY}" >+ local non_source="${dp_USE_PACKAGE_DEPENDS}${dp_USE_REPO_DEPENDS}${no_source}" >+ >+ local success="no" >+ >+ if [ -n "${non_source}" -a "${target}" = "${dp_DEPENDS_TARGET}" ]; then >+ read pkgbase <<- EOF >+ $(${dp_MAKE} -C ${origin} -VPKGBASE) >+ EOF >+ >+ local use_package="${dp_USE_PACKAGE_DEPENDS}${dp_USE_PACKAGE_DEPENDS_ONLY}" >+ if [ -n "${use_package}" -a "${success}" = "no" ]; then >+ read pkgfile <<- EOF >+ $(${dp_MAKE} -C ${origin} -VPKGFILE) >+ EOF >+ >+ if [ -r "${pkgfile}" ]; then >+ echo "===> Installing existing package ${pkgfile}" >+ if [ "${pkgbase}" = "pkg" -o "${pkgbase}" = "pkg-devel" ]; then >+ [ -d ${dp_WRKDIR} ] || mkdir -p ${dp_WRKDIR} >+ tar xf ${pkgfile} -C ${dp_WRKDIR} -s ",/.*/,,g" "*/pkg-static" >+ ${dp_WRKDIR}/pkg-static add ${pkgfile} && success="yes" >+ rm -f ${dp_WRKDIR}/pkg-static >+ else >+ ${dp_PKG_ADD} -A ${pkgfile} && success="yes" >+ fi >+ fi >+ fi > >- read pkgfile <<- EOF >- $(${dp_MAKE} -C ${origin} -VPKGFILE) >- EOF >- read pkgbase <<- EOF >- $(${dp_MAKE} -C ${origin} -VPKGBASE) >- EOF >- if [ -r "${pkgfile}" -a "${target}" = "${dp_DEPENDS_TARGET}" ]; then >- echo "===> Installing existing package ${pkgfile}" >- if [ "${pkgbase}" = "pkg" ]; then >- [ -d ${dp_WRKDIR} ] || mkdir -p ${dp_WRKDIR} >- tar xf ${pkgfile} -C ${dp_WRKDIR} -s ",/.*/,,g" "*/pkg-static" >- ${dp_WRKDIR}/pkg-static add ${pkgfile} >- rm -f ${dp_WRKDIR}/pkg-static >- else >- ${dp_PKG_ADD} -A ${pkgfile} >+ local use_repo="${dp_USE_REPO_DEPENDS}${dp_USE_REPO_DEPENDS_ONLY}" >+ if [ -n "${use_repo}" -a "${success}" = "no" ]; then >+ echo "===> Installing package ${pkgbase} from repository" >+ env ASSUME_ALWAYS_YES=yes ${dp_PKG_INSTALL} -A ${pkgbase} && success="yes" > fi >- elif [ -n "${dp_USE_PACKAGE_DEPENDS_ONLY}" -a "${target}" = "${dp_DEPENDS_TARGET}" ]; then >- echo "===> ${dp_PKGNAME} depends on package: ${pkgfile} - not found" >&2 >- echo "===> dp_USE_PACKAGE_DEPENDS_ONLY set - not building missing dependency from source" >&2 >- exit 1 >- else >+ >+ if [ -n "${no_source}" -a "${success}" = "no" ]; then >+ echo "===> ${dp_PKGNAME} depends on package: ${pkgfile} - not found" >&2 >+ echo "===> dp_USE_PACKAGE_DEPENDS_ONLY or dp_USE_REPO_DEPENDS_ONLY set" >&2 >+ echo "===> not building missing dependency from source" >&2 >+ exit 1 >+ fi >+ fi >+ >+ if [ ${success} = no ]; then > ${dp_MAKE} -C ${origin} -DINSTALLS_DEPENDS ${target} ${depends_args} > fi > } >diff --git a/Mk/bsd.commands.mk b/Mk/bsd.commands.mk >index f1c9b0d..25095cf 100644 >--- a/Mk/bsd.commands.mk >+++ b/Mk/bsd.commands.mk >@@ -129,5 +129,6 @@ PKG_VERSION?= ${PKG_BIN} version > PKG_CREATE?= ${PKG_BIN} create > PKG_ADD?= ${PKG_BIN} add > PKG_QUERY?= ${PKG_BIN} query >+PKG_INSTALL?= ${PKG_BIN} install -y > > .endif >diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk >index a4aaafe..a3a75dd 100644 >--- a/Mk/bsd.port.mk >+++ b/Mk/bsd.port.mk >@@ -1043,6 +1043,12 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org > # if an existing package is not present. > # USE_PACKAGE_DEPENDS_ONLY > # - Like USE_PACKAGE_DEPENDS, but do not fallback on source. >+# USE_REPO_DEPENDS >+# - Try to install dependencies from package repositories >+# instead of building the port from scratch. Fall back on >+# source if the package is not available in the repository. >+# USE_REPO_DEPENDS_ONLY >+# - Like USE_REPO_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. >@@ -4341,8 +4347,11 @@ ${deptype:tl}-depends: > dp_DEPENDS_ARGS="${DEPENDS_ARGS}" \ > dp_USE_PACKAGE_DEPENDS="${USE_PACKAGE_DEPENDS}" \ > dp_USE_PACKAGE_DEPENDS_ONLY="${USE_PACKAGE_DEPENDS_ONLY}" \ >+ dp_USE_REPO_DEPENDS="${USE_REPO_DEPENDS}" \ >+ dp_USE_REPO_DEPENDS_ONLY="${USE_REPO_DEPENDS_ONLY}" \ > dp_PKG_ADD="${PKG_ADD}" \ > dp_PKG_INFO="${PKG_INFO}" \ >+ dp_PKG_INSTALL="${PKG_INSTALL}" \ > dp_WRKDIR="${WRKDIR}" \ > dp_PKGNAME="${PKGNAME}" \ > dp_STRICT_DEPENDS="${STRICT_DEPENDS}" \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 198881
:
154774
|
154775
|
158096
|
160131
| 164242