FreeBSD Bugzilla – Attachment 160131 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]
Patch v2.0.0
mk.diff (text/plain), 4.87 KB, created by
David Naylor
on 2015-08-20 07:13:05 UTC
(
hide
)
Description:
Patch v2.0.0
Filename:
MIME Type:
Creator:
David Naylor
Created:
2015-08-20 07:13:05 UTC
Size:
4.87 KB
patch
obsolete
>diff -ur /usr/ports/Mk/Scripts/do-depends.sh Mk/Scripts/do-depends.sh >--- /usr/ports/Mk/Scripts/do-depends.sh 2015-08-20 08:30:36.069260627 +0200 >+++ Mk/Scripts/do-depends.sh 2015-08-20 08:30:18.199257583 +0200 >@@ -11,41 +11,61 @@ > 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 dp_PORTSDIR dp_MAKE >+ dp_SCRIPTSDIR dp_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 >+ >+ 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 > >- 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} >+ 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 >- 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 >+ fi >+ >+ if [ ${success} = no ]; then > ${dp_MAKE} -C ${origin} -DINSTALLS_DEPENDS ${target} ${depends_args} > fi > } >diff -ur /usr/ports/Mk/bsd.commands.mk Mk/bsd.commands.mk >--- /usr/ports/Mk/bsd.commands.mk 2015-08-20 08:30:36.069260627 +0200 >+++ Mk/bsd.commands.mk 2015-08-20 08:29:53.529258171 +0200 >@@ -129,5 +129,6 @@ > PKG_CREATE?= ${PKG_BIN} create > PKG_ADD?= ${PKG_BIN} add > PKG_QUERY?= ${PKG_BIN} query >+PKG_INSTALL?= ${PKG_BIN} install -y > > .endif >diff -ur /usr/ports/Mk/bsd.port.mk Mk/bsd.port.mk >--- /usr/ports/Mk/bsd.port.mk 2015-08-20 08:30:36.069260627 +0200 >+++ Mk/bsd.port.mk 2015-08-19 08:19:40.772057780 +0200 >@@ -1021,6 +1021,12 @@ > # 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. >@@ -4270,8 +4276,11 @@ > 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