View | Details | Raw Unified | Return to bug 198881 | Differences between
and this patch

Collapse All | Expand All

(-)b/Mk/Scripts/do-depends.sh (-28 / +48 lines)
Lines 11-51 validate_env dp_RAWDEPENDS dp_DEPTYPE dp_DEPENDS_TARGET dp_DEPENDS_PRECLEAN \ Link Here
11
	dp_DEPENDS_CLEAN dp_DEPENDS_ARGS dp_USE_PACKAGE_DEPENDS \
11
	dp_DEPENDS_CLEAN dp_DEPENDS_ARGS dp_USE_PACKAGE_DEPENDS \
12
	dp_USE_PACKAGE_DEPENDS_ONLY dp_PKG_ADD dp_PKG_INFO dp_WRKDIR \
12
	dp_USE_PACKAGE_DEPENDS_ONLY dp_PKG_ADD dp_PKG_INFO dp_WRKDIR \
13
	dp_PKGNAME dp_STRICT_DEPENDS dp_LOCALBASE dp_LIB_DIRS dp_SH \
13
	dp_PKGNAME dp_STRICT_DEPENDS dp_LOCALBASE dp_LIB_DIRS dp_SH \
14
	dp_SCRIPTSDIR PORTSDIR dp_MAKE
14
	dp_SCRIPTSDIR PORTSDIR dp_MAKE dp_USE_REPO_DEPENDS \
15
	dp_USE_REPO_DEPENDS_ONLY dp_PKG_INSTALL
15
16
16
set -u
17
set -u
17
18
18
install_depends()
19
install_depends()
19
{
20
{
20
	origin=$1
21
	local origin=$1
21
	target=$2
22
	local target=$2
22
	depends_args=$3
23
	local depends_args=$3
23
	if [ -z "${dp_USE_PACKAGE_DEPENDS}" -a -z "${dp_USE_PACKAGE_DEPENDS_ONLY}" ]; then
24
24
		${dp_MAKE} -C ${origin} -DINSTALLS_DEPENDS ${target} ${depends_args}
25
	local no_source="${dp_USE_PACKAGE_DEPENDS_ONLY}${dp_USE_REPO_DEPENDS_ONLY}"
25
		return 0
26
	local non_source="${dp_USE_PACKAGE_DEPENDS}${dp_USE_REPO_DEPENDS}${no_source}"
26
	fi
27
28
	local success="no"
29
30
	if [ -n "${non_source}" -a "${target}" = "${dp_DEPENDS_TARGET}" ]; then
31
		read pkgbase <<- EOF
32
		$(${dp_MAKE} -C ${origin} -VPKGBASE)
33
		EOF
34
35
		local use_package="${dp_USE_PACKAGE_DEPENDS}${dp_USE_PACKAGE_DEPENDS_ONLY}"
36
		if [ -n "${use_package}" -a "${success}" = "no" ]; then
37
			read pkgfile <<- EOF
38
			$(${dp_MAKE} -C ${origin} -VPKGFILE)
39
			EOF
40
41
			if [ -r "${pkgfile}" ]; then
42
				echo "===>   Installing existing package ${pkgfile}"
43
				if [ "${pkgbase}" = "pkg" -o "${pkgbase}" = "pkg-devel" ]; then
44
					[ -d ${dp_WRKDIR} ] || mkdir -p ${dp_WRKDIR}
45
					tar xf ${pkgfile} -C ${dp_WRKDIR} -s ",/.*/,,g" "*/pkg-static"
46
					${dp_WRKDIR}/pkg-static add ${pkgfile} && success="yes"
47
					rm -f ${dp_WRKDIR}/pkg-static
48
				else
49
					${dp_PKG_ADD} -A ${pkgfile} && success="yes"
50
				fi
51
			fi
52
		fi
27
53
28
	read pkgfile <<- EOF
54
		local use_repo="${dp_USE_REPO_DEPENDS}${dp_USE_REPO_DEPENDS_ONLY}"
29
	$(${dp_MAKE} -C ${origin} -VPKGFILE)
55
		if [ -n "${use_repo}" -a "${success}" = "no" ]; then
30
	EOF
56
			echo "===>   Installing package ${pkgbase} from repository"
31
	read pkgbase <<- EOF
57
			env ASSUME_ALWAYS_YES=yes ${dp_PKG_INSTALL} -A ${pkgbase} && success="yes"
32
	$(${dp_MAKE} -C ${origin} -VPKGBASE)
33
	EOF
34
	if [ -r "${pkgfile}" -a "${target}" = "${dp_DEPENDS_TARGET}" ]; then
35
		echo "===>   Installing existing package ${pkgfile}"
36
		if [ "${pkgbase}" = "pkg" ]; then
37
			[ -d ${dp_WRKDIR} ] || mkdir -p ${dp_WRKDIR}
38
			tar xf ${pkgfile} -C ${dp_WRKDIR} -s ",/.*/,,g" "*/pkg-static"
39
			${dp_WRKDIR}/pkg-static add ${pkgfile}
40
			rm -f ${dp_WRKDIR}/pkg-static
41
		else
42
			${dp_PKG_ADD} -A ${pkgfile}
43
		fi
58
		fi
44
	elif [ -n "${dp_USE_PACKAGE_DEPENDS_ONLY}" -a "${target}" = "${dp_DEPENDS_TARGET}" ]; then
59
45
		echo "===>   ${dp_PKGNAME} depends on package: ${pkgfile} - not found" >&2
60
		if [ -n "${no_source}" -a "${success}" = "no" ]; then
46
		echo "===>   dp_USE_PACKAGE_DEPENDS_ONLY set - not building missing dependency from source" >&2
61
			echo "===>   ${dp_PKGNAME} depends on package: ${pkgfile} - not found" >&2
47
		exit 1
62
			echo "===>   dp_USE_PACKAGE_DEPENDS_ONLY or dp_USE_REPO_DEPENDS_ONLY set" >&2
48
	else
63
			echo "===>   not building missing dependency from source" >&2
64
			exit 1
65
		fi
66
	fi
67
68
	if [ ${success} = no ]; then
49
		${dp_MAKE} -C ${origin} -DINSTALLS_DEPENDS ${target} ${depends_args}
69
		${dp_MAKE} -C ${origin} -DINSTALLS_DEPENDS ${target} ${depends_args}
50
	fi
70
	fi
51
}
71
}
(-)b/Mk/bsd.commands.mk (+1 lines)
Lines 129-133 PKG_VERSION?= ${PKG_BIN} version Link Here
129
PKG_CREATE?=		${PKG_BIN} create
129
PKG_CREATE?=		${PKG_BIN} create
130
PKG_ADD?=		${PKG_BIN} add
130
PKG_ADD?=		${PKG_BIN} add
131
PKG_QUERY?=		${PKG_BIN} query
131
PKG_QUERY?=		${PKG_BIN} query
132
PKG_INSTALL?=		${PKG_BIN} install -y
132
133
133
.endif
134
.endif
(-)b/Mk/bsd.port.mk (+9 lines)
Lines 1043-1048 FreeBSD_MAINTAINER= portmgr@FreeBSD.org Link Here
1043
#				  if an existing package is not present.
1043
#				  if an existing package is not present.
1044
# USE_PACKAGE_DEPENDS_ONLY
1044
# USE_PACKAGE_DEPENDS_ONLY
1045
#				- Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1045
#				- Like USE_PACKAGE_DEPENDS, but do not fallback on source.
1046
# USE_REPO_DEPENDS
1047
#				- Try to install dependencies from package repositories
1048
#				  instead of building the port from scratch. Fall back on
1049
#				  source if the package is not available in the repository.
1050
# USE_REPO_DEPENDS_ONLY
1051
#				- Like USE_REPO_DEPENDS, but do not fallback on source.
1046
# INSTALL_AS_USER
1052
# INSTALL_AS_USER
1047
#				- Define this to install as the current user, intended
1053
#				- Define this to install as the current user, intended
1048
#				  for systems where you have no root access.
1054
#				  for systems where you have no root access.
Lines 4341-4348 ${deptype:tl}-depends: Link Here
4341
		dp_DEPENDS_ARGS="${DEPENDS_ARGS}" \
4347
		dp_DEPENDS_ARGS="${DEPENDS_ARGS}" \
4342
		dp_USE_PACKAGE_DEPENDS="${USE_PACKAGE_DEPENDS}" \
4348
		dp_USE_PACKAGE_DEPENDS="${USE_PACKAGE_DEPENDS}" \
4343
		dp_USE_PACKAGE_DEPENDS_ONLY="${USE_PACKAGE_DEPENDS_ONLY}" \
4349
		dp_USE_PACKAGE_DEPENDS_ONLY="${USE_PACKAGE_DEPENDS_ONLY}" \
4350
		dp_USE_REPO_DEPENDS="${USE_REPO_DEPENDS}" \
4351
		dp_USE_REPO_DEPENDS_ONLY="${USE_REPO_DEPENDS_ONLY}" \
4344
		dp_PKG_ADD="${PKG_ADD}" \
4352
		dp_PKG_ADD="${PKG_ADD}" \
4345
		dp_PKG_INFO="${PKG_INFO}" \
4353
		dp_PKG_INFO="${PKG_INFO}" \
4354
		dp_PKG_INSTALL="${PKG_INSTALL}" \
4346
		dp_WRKDIR="${WRKDIR}" \
4355
		dp_WRKDIR="${WRKDIR}" \
4347
		dp_PKGNAME="${PKGNAME}" \
4356
		dp_PKGNAME="${PKGNAME}" \
4348
		dp_STRICT_DEPENDS="${STRICT_DEPENDS}" \
4357
		dp_STRICT_DEPENDS="${STRICT_DEPENDS}" \

Return to bug 198881