public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set
@ 2014-12-01 21:28 Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 01/18] Respect nonfatal in unpack(), econf() and einstall() Michał Górny
                   ` (17 more replies)
  0 siblings, 18 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev

Hi,

I've merged the remaining pre-EAPI 6 cleanup with the EAPI 6 patch set,
and rebased it on top of master. Other changes since the previous set:

1. fixed Portage helpers to respect nonfatal properly,

2. removed '--respect-nonfatal' long option from 'die' -- ulm has
suggested that we support only short options for consistency,

3. removed extraneous Python changes from in_iuse() patch,

4. banned einstall and deprecated dohtml as decided on the late Council
meeting.

Please review.

--
Best regards,
Michał Górny



^ permalink raw reply	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 01/18] Respect nonfatal in unpack(), econf() and einstall()
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 02/18] Apply 'nonfatal' to helpers only Michał Górny
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

---
 bin/isolated-functions.sh | 11 ++++--
 bin/phase-helpers.sh      | 87 ++++++++++++++++++++++++++++++++++-------------
 2 files changed, 73 insertions(+), 25 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 42bf05d..ed96bd0 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -36,11 +36,18 @@ __assert_sigpipe_ok() {
 	local x pipestatus=${PIPESTATUS[*]}
 	for x in $pipestatus ; do
 		# Allow SIGPIPE through (128 + 13)
-		[[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]] && die "$@"
+		if [[ $x -ne 0 && $x -ne ${PORTAGE_SIGPIPE_STATUS:-141} ]]
+		then
+			__helpers_die "$@"
+			return 1
+		fi
 	done
 
 	# Require normal success for the last process (tar).
-	[[ $x -eq 0 ]] || die "$@"
+	if [[ $x -ne 0 ]]; then
+		__helpers_die "$@"
+		return 1
+	fi
 }
 
 shopt -s extdebug
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5f7c809..3e63b11 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -285,7 +285,10 @@ unpack() {
 		else
 			srcdir="${DISTDIR}/"
 		fi
-		[[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
+		if [[ ! -s ${srcdir}${x} ]]; then
+			__helpers_die "unpack: ${x} does not exist"
+			return 1
+		fi
 
 		__unpack_tar() {
 			if [[ ${y_insensitive} == tar ]] ; then
@@ -296,15 +299,18 @@ unpack() {
 						"supported with EAPI '${EAPI}'. Instead use 'tar'."
 				fi
 				$1 -c -- "$srcdir$x" | tar xof -
-				__assert_sigpipe_ok "$myfail"
+				__assert_sigpipe_ok "$myfail" || return 1
 			else
 				local cwd_dest=${x##*/}
 				cwd_dest=${cwd_dest%.*}
-				$1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
+				if ! $1 -c -- "${srcdir}${x}" > "${cwd_dest}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 			fi
 		}
 
-		myfail="failure unpacking ${x}"
+		myfail="unpack: failure unpacking ${x}"
 		case "${suffix_insensitive}" in
 			tar)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -313,7 +319,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'tar'."
 				fi
-				tar xof "$srcdir$x" || die "$myfail"
+				if ! tar xof "$srcdir$x"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			tgz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -322,7 +331,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'tgz'."
 				fi
-				tar xozf "$srcdir$x" || die "$myfail"
+				if ! tar xozf "$srcdir$x"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			tbz|tbz2)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -332,7 +344,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'tbz' or 'tbz2'."
 				fi
 				${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
-				__assert_sigpipe_ok "$myfail"
+				__assert_sigpipe_ok "$myfail" || return 1
 				;;
 			zip|jar)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -344,8 +356,10 @@ unpack() {
 				fi
 				# unzip will interactively prompt under some error conditions,
 				# as reported in bug #336285
-				( set +x ; while true ; do echo n || break ; done ) | \
-				unzip -qo "${srcdir}${x}" || die "$myfail"
+				if ! unzip -qo "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi < <(set +x ; while true ; do echo n || break ; done)
 				;;
 			gz|z)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -354,7 +368,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'gz', 'z', or 'Z'."
 				fi
-				__unpack_tar "gzip -d"
+				__unpack_tar "gzip -d" || return 1
 				;;
 			bz2|bz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -363,7 +377,8 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'bz' or 'bz2'."
 				fi
-				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
+				__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}" \
+					|| return 1
 				;;
 			7z)
 				local my_output
@@ -380,7 +395,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'rar' or 'RAR'."
 				fi
-				unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
+				if ! unrar x -idq -o+ "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			lha|lzh)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -390,7 +408,10 @@ unpack() {
 						"with EAPI '${EAPI}'." \
 						"Instead use 'LHA', 'LHa', 'lha', or 'lzh'."
 				fi
-				lha xfq "${srcdir}${x}" || die "$myfail"
+				if ! lha xfq "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			a)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -399,7 +420,10 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'a'."
 				fi
-				ar x "${srcdir}${x}" || die "$myfail"
+				if ! ar x "${srcdir}${x}"; then
+					__helpers_die "$myfail"
+					return 1
+				fi
 				;;
 			deb)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -420,18 +444,30 @@ unpack() {
 						# deb2targz always extracts into the same directory as
 						# the source file, so create a symlink in the current
 						# working directory if necessary.
-						ln -sf "$srcdir$x" "$y" || die "$myfail"
+						if ! ln -sf "$srcdir$x" "$y"; then
+							__helpers_die "$myfail"
+							return 1
+						fi
 						created_symlink=1
 					fi
-					deb2targz "$y" || die "$myfail"
+					if ! deb2targz "$y"; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 					if [ $created_symlink = 1 ] ; then
 						# Clean up the symlink so the ebuild
 						# doesn't inadvertently install it.
 						rm -f "$y"
 					fi
-					mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
+					if ! mv -f "${y%.deb}".tar.gz data.tar.gz; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 				else
-					ar x "$srcdir$x" || die "$myfail"
+					if ! ar x "$srcdir$x"; then
+						__helpers_die "$myfail"
+						return 1
+					fi
 				fi
 				;;
 			lzma)
@@ -441,7 +477,7 @@ unpack() {
 						"suffix '${suffix}' which is unofficially supported" \
 						"with EAPI '${EAPI}'. Instead use 'lzma'."
 				fi
-				__unpack_tar "lzma -d"
+				__unpack_tar "lzma -d" || return 1
 				;;
 			xz)
 				if ___eapi_unpack_is_case_sensitive && \
@@ -451,7 +487,7 @@ unpack() {
 						"with EAPI '${EAPI}'. Instead use 'xz'."
 				fi
 				if ___eapi_unpack_supports_xz; then
-					__unpack_tar "xz -d"
+					__unpack_tar "xz -d" || return 1
 				else
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
@@ -581,7 +617,8 @@ econf() {
 				echo "!!! Please attach the following file when seeking support:"
 				echo "!!! ${PWD}/config.log"
 			fi
-			die "econf failed"
+			__helpers_die "econf failed"
+			return 1
 		fi
 	elif [ -f "${ECONF_SOURCE}/configure" ]; then
 		die "configure is not executable"
@@ -620,7 +657,7 @@ einstall() {
 				${MAKEOPTS} -j1 \
 				"$@" ${EXTRA_EMAKE} install
 		fi
-		${MAKE:-make} prefix="${ED}usr" \
+		if ! ${MAKE:-make} prefix="${ED}usr" \
 			datadir="${ED}usr/share" \
 			infodir="${ED}usr/share/info" \
 			localstatedir="${ED}var/lib" \
@@ -628,7 +665,11 @@ einstall() {
 			sysconfdir="${ED}etc" \
 			${LOCAL_EXTRA_EINSTALL} \
 			${MAKEOPTS} -j1 \
-			"$@" ${EXTRA_EMAKE} install || die "einstall failed"
+			"$@" ${EXTRA_EMAKE} install
+		then
+			__helpers_die "einstall failed"
+			return 1
+		fi
 	else
 		die "no Makefile found"
 	fi
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 02/18] Apply 'nonfatal' to helpers only
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 01/18] Respect nonfatal in unpack(), econf() and einstall() Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 03/18] Support EAPI=6_pre1 for testing EAPI6 features Michał Górny
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Make 'nonfatal' modifier affect helpers only rather than disabling 'die'
completely. This improves the PMS conformance.
---
 bin/isolated-functions.sh | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index ed96bd0..251d7ee 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -113,7 +113,7 @@ __bashpid() {
 }
 
 __helpers_die() {
-	if ___eapi_helpers_can_die; then
+	if ___eapi_helpers_can_die && [[ ${PORTAGE_NONFATAL} != 1 ]]; then
 		die "$@"
 	else
 		echo -e "$@" >&2
@@ -123,11 +123,6 @@ __helpers_die() {
 die() {
 	local IFS=$' \t\n'
 
-	if [[ $PORTAGE_NONFATAL -eq 1 ]]; then
-		echo -e " $WARN*$NORMAL ${FUNCNAME[1]}: WARNING: $@" >&2
-		return 1
-	fi
-
 	set +e
 	if [ -n "${QA_INTERCEPTORS}" ] ; then
 		# die was called from inside inherit. We need to clean up
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 03/18] Support EAPI=6_pre1 for testing EAPI6 features
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 01/18] Respect nonfatal in unpack(), econf() and einstall() Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 02/18] Apply 'nonfatal' to helpers only Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 04/18] Add tentative support for EAPI6 --docdir and --htmldir Michał Górny
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

---
 pym/portage/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index d8046f3..835fc6f 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -491,7 +491,7 @@ def abssymlink(symlink, target=None):
 
 _doebuild_manifest_exempt_depend = 0
 
-_testing_eapis = frozenset(["4-python", "4-slot-abi", "5-progress", "5-hdepend"])
+_testing_eapis = frozenset(["4-python", "4-slot-abi", "5-progress", "5-hdepend", "6_pre1"])
 _deprecated_eapis = frozenset(["4_pre1", "3_pre2", "3_pre1", "5_pre1", "5_pre2"])
 _supported_eapis = frozenset([str(x) for x in range(portage.const.EAPI + 1)] + list(_testing_eapis) + list(_deprecated_eapis))
 
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 04/18] Add tentative support for EAPI6 --docdir and --htmldir
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (2 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 03/18] Support EAPI=6_pre1 for testing EAPI6 features Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 05/18] Add tentative support for EAPI6 get_libdir() Michał Górny
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Pass --docdir and --htmldir to configure scripts that support it.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 623b89f..5f96c3b 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -110,6 +110,10 @@ ___eapi_econf_passes_--disable-silent-rules() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
+___eapi_econf_passes_--docdir_and_--htmldir() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_use_enable_and_use_with_support_empty_third_argument() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3e63b11..9738a3a 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -558,7 +558,7 @@ econf() {
 		fi
 
 		local conf_args=()
-		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules; then
+		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules || ___eapi_econf_passes_--docdir_and_--htmldir; then
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
@@ -572,6 +572,16 @@ econf() {
 					conf_args+=( --disable-silent-rules )
 				fi
 			fi
+
+			if ___eapi_econf_passes_--docdir_and_--htmldir; then
+				if [[ ${conf_help} == *--docdir* ]]; then
+					conf_args+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
+				fi
+
+				if [[ ${conf_help} == *--htmldir* ]]; then
+					conf_args+=( --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html )
+				fi
+			fi
 		fi
 
 		# if the profile defines a location to install libs to aside from default, pass it on.
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 05/18] Add tentative support for EAPI6 get_libdir()
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (3 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 04/18] Add tentative support for EAPI6 --docdir and --htmldir Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 06/18] Add tentative support for EAPI6 einstalldocs function Michał Górny
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add get_libdir() function to obtain the basename of libdir using
the same algorithm that econf uses.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 5f96c3b..6ace20d 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -64,6 +64,10 @@ ___eapi_has_usex() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]]
 }
 
+___eapi_has_get_libdir() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 9738a3a..764b968 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -885,6 +885,17 @@ best_version() {
 	esac
 }
 
+if ___eapi_has_get_libdir; then
+	get_libdir() {
+		local libdir_var="LIBDIR_${ABI}"
+		local libdir="lib"
+
+		[[ -n ${ABI} && -n ${!libdir_var} ]] && libdir=${!libdir_var}
+
+		echo "${libdir}"
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 06/18] Add tentative support for EAPI6 einstalldocs function
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (4 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 05/18] Add tentative support for EAPI6 get_libdir() Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 07/18] Add tentative support for EAPI6 eapply function Michał Górny
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add the einstalldocs function to conveniently install documentation
using the default patterns or DOCS and HTML_DOCS variables.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6ace20d..978a410 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -68,6 +68,10 @@ ___eapi_has_get_libdir() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_einstalldocs() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 764b968..e401676 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -896,6 +896,34 @@ if ___eapi_has_get_libdir; then
 	}
 fi
 
+if ___eapi_has_einstalldocs; then
+	einstalldocs() {
+		(
+			docinto .
+			if ! declare -p DOCS &>/dev/null ; then
+				local d
+				for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+						THANKS BUGS FAQ CREDITS CHANGELOG ; do
+					[[ -s ${d} ]] && dodoc "${d}"
+				done
+			elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
+				[[ ${DOCS[@]} ]] && dodoc -r "${DOCS[@]}"
+			else
+				[[ ${DOCS} ]] && dodoc -r ${DOCS}
+			fi
+		)
+
+		(
+			docinto html
+			if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
+				[[ ${HTML_DOCS[@]} ]] && dodoc -r "${HTML_DOCS[@]}"
+			else
+				[[ ${HTML_DOCS} ]] && dodoc -r ${HTML_DOCS}
+			fi
+		)
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 07/18] Add tentative support for EAPI6 eapply function
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (5 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 06/18] Add tentative support for EAPI6 einstalldocs function Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function Michał Górny
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add the eapply patch applying function.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 978a410..8ffffbb 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -72,6 +72,10 @@ ___eapi_has_einstalldocs() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_eapply() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e401676..e9fbbb4 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -924,6 +924,68 @@ if ___eapi_has_einstalldocs; then
 	}
 fi
 
+if ___eapi_has_eapply; then
+	eapply() {
+		_eapply_patch() {
+			local f=${1}
+			local prefix=${2}
+
+			started_applying=1
+			ebegin "${prefix:-Applying }${f##*/}"
+			# -p1 as a sane default
+			# -f to avoid interactivity
+			# -s to silence progress output
+			patch -p1 -f -s "${patch_options[@]}" < "${f}"
+			if ! eend ${?}; then
+				__helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"
+				failed=1
+			fi
+		}
+
+		local f patch_options=() failed started_applying options_terminated
+		for f; do
+			if [[ ${f} == -* && -z ${options_terminated} ]]; then
+				if [[ -n ${started_applying} ]]; then
+					die "eapply: options need to be specified before files"
+				fi
+				if [[ ${f} == -- ]]; then
+					options_terminated=1
+				else
+					patch_options+=( ${f} )
+				fi
+			elif [[ -d ${f} ]]; then
+				_eapply_get_files() {
+					local LC_ALL=POSIX
+					local prev_shopt=$(shopt -p nullglob)
+					shopt -s nullglob
+					files=( "${f}"/*.{patch,diff} )
+					${prev_shopt}
+				}
+
+				local files
+				_eapply_get_files
+				[[ -z ${files[@]} ]] && die "No *.{patch,diff} files in directory ${f}"
+
+				einfo "Applying patches from ${f} ..."
+				local f2
+				for f2 in "${files[@]}"; do
+					_eapply_patch "${f2}" '  '
+
+					# in case of nonfatal
+					[[ -n ${failed} ]] && return 1
+				done
+			else
+				_eapply_patch "${f}"
+
+				# in case of nonfatal
+				[[ -n ${failed} ]] && return 1
+			fi
+		done
+
+		return 0
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (6 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 07/18] Add tentative support for EAPI6 eapply function Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2017-02-09 22:39   ` Zac Medico
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 09/18] Enable tentative EAPI6 failglob in global scope Michał Górny
                   ` (9 subsequent siblings)
  17 siblings, 1 reply; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add support for the user patch applying function.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 8ffffbb..6e78750 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -76,6 +76,10 @@ ___eapi_has_eapply() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_eapply_user() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e9fbbb4..f4b64ee 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -986,6 +986,28 @@ if ___eapi_has_eapply; then
 	}
 fi
 
+if ___eapi_has_eapply_user; then
+	eapply_user() {
+		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
+
+		local d applied
+		# possibilities:
+		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
+		#    ${P} twice)
+		# 2. ${CATEGORY}/${P}
+		# 3. ${CATEGORY}/${PN}
+		# all of the above may be optionally followed by a slot
+		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
+			if [[ -d ${d} ]]; then
+				eapply "${d}"
+				applied=1
+			fi
+		done
+
+		[[ -n ${applied} ]] && ewarn "User patches applied."
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 09/18] Enable tentative EAPI6 failglob in global scope
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (7 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 10/18] Enable tentative support for EAPI6 profile-level directories Michał Górny
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Enable failglob in global scope to catch unintended globbing attempts
including unescaped special uses of '*'.
---
 bin/eapi.sh   |  4 ++++
 bin/ebuild.sh | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6e78750..fa57999 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -160,6 +160,10 @@ ___eapi_unpack_is_case_sensitive() {
 
 # OTHERS
 
+___eapi_enables_failglob_in_global_scope() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_enables_globstar() {
 	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 }
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 232bf44..3965acf 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -563,6 +563,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		# we make a backup copy for QA checks.
 		__INHERITED_QA_CACHE=$INHERITED
 
+		# Catch failed globbing attempts in case ebuild writer forgot to
+		# escape '*' or likes.
+		# Note: this needs to be done before unsetting EAPI.
+		if ___eapi_enables_failglob_in_global_scope; then
+			shopt -s failglob
+		fi
+
 		# *DEPEND and IUSE will be set during the sourcing of the ebuild.
 		# In order to ensure correct interaction between ebuilds and
 		# eclasses, they need to be unset before this process of
@@ -579,6 +586,10 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 			set +x
 		fi
 
+		if ___eapi_enables_failglob_in_global_scope; then
+			shopt -u failglob
+		fi
+
 		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
 			RESTRICT=${PORTAGE_RESTRICT}
 			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 10/18] Enable tentative support for EAPI6 profile-level directories
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (8 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 09/18] Enable tentative EAPI6 failglob in global scope Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 11/18] Add tentative EAPI6 .txz unpack support Michał Górny
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Enable the support for package.* and use.* directories on profile and
repository level.
---
 pym/portage/eapi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 4f77910..7217d23 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -81,7 +81,7 @@ def eapi_supports_stable_use_forcing_and_masking(eapi):
 	return eapi not in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi")
 
 def eapi_allows_directories_on_profile_level_and_repository_level(eapi):
-	return eapi in ("4-python", "5-progress")
+	return eapi not in ("0", "1", "2", "3", "4", "4-slot-abi", "5")
 
 def eapi_has_use_aliases(eapi):
 	return eapi in ("4-python", "5-progress")
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 11/18] Add tentative EAPI6 .txz unpack support
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (9 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 10/18] Enable tentative support for EAPI6 profile-level directories Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 12/18] Add tentative EAPI6 absolute path support to unpack() Michał Górny
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Support unpacking .txz-suffixed archives.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index fa57999..878f8e7 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -118,6 +118,10 @@ ___eapi_unpack_supports_xz() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2)$ ]]
 }
 
+___eapi_unpack_supports_txz() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_econf_passes_--disable-dependency-tracking() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index f4b64ee..182a872 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -492,6 +492,19 @@ unpack() {
 					__vecho "unpack ${x}: file format not recognized. Ignoring."
 				fi
 				;;
+			txz)
+				if ___eapi_unpack_is_case_sensitive && \
+					[[ " txz " != *" ${suffix} "* ]] ; then
+					eqawarn "QA Notice: unpack called with" \
+						"suffix '${suffix}' which is unofficially supported" \
+						"with EAPI '${EAPI}'. Instead use 'txz'."
+				fi
+				if ___eapi_supports_txz; then
+					__unpack_tar "xz -d" || return 1
+				else
+					__vecho "unpack ${x}: file format not recognized. Ignoring."
+				fi
+				;;
 			*)
 				__vecho "unpack ${x}: file format not recognized. Ignoring."
 				;;
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 12/18] Add tentative EAPI6 absolute path support to unpack()
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (10 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 11/18] Add tentative EAPI6 .txz unpack support Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 13/18] Add tentative EAPI6 nonfatal support to die() Michał Górny
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add support for absolute paths in unpack(). Allow subdirectory-level
relative paths not to start with './'.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 29 ++++++++++++++++++++++-------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 878f8e7..6716b1c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -162,6 +162,10 @@ ___eapi_unpack_is_case_sensitive() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
+___eapi_unpack_supports_absolute_paths() {
+	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
+}
+
 # OTHERS
 
 ___eapi_enables_failglob_in_global_scope() {
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 182a872..a6e1cdb 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -276,14 +276,29 @@ unpack() {
 		y=${y##*.}
 		y_insensitive=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
 
-		if [[ ${x} == "./"* ]] ; then
-			srcdir=""
-		elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
-			die "Arguments to unpack() cannot begin with \${DISTDIR}."
-		elif [[ ${x} == "/"* ]] ; then
-			die "Arguments to unpack() cannot be absolute"
+		# wrt PMS 11.3.3.13 Misc Commands
+		if [[ ${x} != */* ]]; then
+			# filename without path of any kind
+			srcdir=${DISTDIR}/
+		elif [[ ${x} == ./* ]]; then
+			# relative path starting with './'
+			srcdir=
 		else
-			srcdir="${DISTDIR}/"
+			# non-'./' filename with path of some kind
+			if ___eapi_unpack_supports_absolute_paths; then
+				# EAPI 6 allows absolute and deep relative paths
+				srcdir=
+
+				if [[ ${x} == ${DISTDIR%/}/* ]]; then
+					eqawarn "QA Notice: unpack called with redundant \${DISTDIR} in path"
+				fi
+			elif [[ ${x} == ${DISTDIR%/}/* ]]; then
+				die "Arguments to unpack() cannot begin with \${DISTDIR} in EAPI ${EAPI}"
+			elif [[ ${x} == /* ]] ; then
+				die "Arguments to unpack() cannot be absolute in EAPI ${EAPI}"
+			else
+				die "Relative paths to unpack() must be prefixed with './' in EAPI ${EAPI}"
+			fi
 		fi
 		if [[ ! -s ${srcdir}${x} ]]; then
 			__helpers_die "unpack: ${x} does not exist"
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 13/18] Add tentative EAPI6 nonfatal support to die()
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (11 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 12/18] Add tentative EAPI6 absolute path support to unpack() Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 14/18] Add tentative EAPI6 in_iuse() function Michał Górny
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add support for die() to respect 'nonfatal' modifier if
'--respect-nonfatal' (or '-n') option is used. This allows eclasses
to create custom ebuild helpers that mimic built-in helper behavior.
---
 bin/eapi.sh               | 4 ++++
 bin/isolated-functions.sh | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 6716b1c..c650a4c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -166,6 +166,10 @@ ___eapi_unpack_supports_absolute_paths() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
+___eapi_die_can_respect_nonfatal() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 # OTHERS
 
 ___eapi_enables_failglob_in_global_scope() {
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 251d7ee..8e789ec 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -123,6 +123,13 @@ __helpers_die() {
 die() {
 	local IFS=$' \t\n'
 
+	if ___eapi_die_can_respect_nonfatal; then
+		if [[ ${1} == -n ]]; then
+			[[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
+			shift
+		fi
+	fi
+
 	set +e
 	if [ -n "${QA_INTERCEPTORS}" ] ; then
 		# die was called from inside inherit. We need to clean up
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 14/18] Add tentative EAPI6 in_iuse() function
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (12 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 13/18] Add tentative EAPI6 nonfatal support to die() Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 15/18] Add tentative EAPI6 phase functions Michał Górny
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add a function to query IUSE_EFFECTIVE for flags.
---
 bin/eapi.sh          |  4 ++++
 bin/phase-helpers.sh | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index c650a4c..e0ade02 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -80,6 +80,10 @@ ___eapi_has_eapply_user() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_in_iuse() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_master_repositories() {
 	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index a6e1cdb..e2376bf 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1036,6 +1036,22 @@ if ___eapi_has_eapply_user; then
 	}
 fi
 
+if ___eapi_has_in_iuse; then
+	in_iuse() {
+		local use=${1}
+
+		if [[ -z "${use}" ]]; then
+			echo "!!! in_iuse() called without a parameter." >&2
+			echo "!!! in_iuse <USEFLAG>" >&2
+			die "in_iuse() called without a parameter"
+		fi
+
+		local liuse=( ${IUSE_EFFECTIVE} )
+
+		has "${use}" "${liuse[@]#[+-]}"
+	}
+fi
+
 if ___eapi_has_master_repositories; then
 	master_repositories() {
 		local output repository=$1 retval
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 15/18] Add tentative EAPI6 phase functions
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (13 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 14/18] Add tentative EAPI6 in_iuse() function Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6 Michał Górny
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

---
 bin/phase-functions.sh | 11 +++++++++++
 bin/phase-helpers.sh   | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index ee28c27..aec86fd 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -828,6 +828,17 @@ __ebuild_phase_funcs() {
 				declare -F src_install >/dev/null || \
 					src_install() { default; }
 			fi
+
+			# defaults starting with EAPI 6
+			if ! has ${eapi} 2 3 4 4-python 4-slot-abi 5 5-progress 5-hdepend; then
+				[[ ${phase_func} == src_prepare ]] && \
+					default_src_prepare() { __eapi6_src_prepare; }
+				[[ ${phase_func} == src_install ]] && \
+					default_src_install() { __eapi6_src_install; }
+
+				declare -F src_prepare >/dev/null || \
+					src_prepare() { default; }
+			fi
 			;;
 	esac
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index e2376bf..5605efd 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -795,6 +795,24 @@ __eapi4_src_install() {
 	fi
 }
 
+__eapi6_src_prepare() {
+	if [[ $(declare -p PATCHES) == "declare -a"* ]]; then
+		eapply "${PATCHES[@]}"
+	elif [[ -n ${PATCHES} ]]; then
+		eapply ${PATCHES}
+	fi
+
+	eapply_user
+}
+
+__eapi6_src_install() {
+	if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+		emake DESTDIR="${D}" install
+	fi
+
+	einstalldocs
+}
+
 # @FUNCTION: has_version
 # @USAGE: [--host-root] <DEPEND ATOM>
 # @DESCRIPTION:
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (14 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 15/18] Add tentative EAPI6 phase functions Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2015-01-16 10:14   ` Sergei Trofimovich
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 17/18] Ban einstall for " Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 18/18] Deprecate dohtml " Michał Górny
  17 siblings, 1 reply; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Disallow calling most of the ebuild helpers in global scope since they
are meaningless in that context. Most of them are also prohibited by PMS
for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
that restriction.
---
 bin/eapi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e0ade02..5ab92f4 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
 }
 
 ___eapi_disallows_helpers_in_global_scope() {
-	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_unpack_is_case_sensitive() {
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 17/18] Ban einstall for EAPI 6
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (15 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6 Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 18/18] Deprecate dohtml " Michał Górny
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

---
 bin/eapi.sh          | 4 ++++
 bin/phase-helpers.sh | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 5ab92f4..b27b57c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -48,6 +48,10 @@ ___eapi_has_dosed() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }
 
+___eapi_has_einstall() {
+	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_docompress() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5605efd..6e437da 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -666,6 +666,11 @@ econf() {
 }
 
 einstall() {
+	if ! ___eapi_has_einstall; then
+		die "'${FUNCNAME}' has been banned for EAPI '$EAPI'"
+		exit 1
+	fi
+
 	# CONF_PREFIX is only set if they didn't pass in libdir above.
 	local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
 	if ! ___eapi_has_prefix_variables; then
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [gentoo-portage-dev] [PATCH 18/18] Deprecate dohtml for EAPI 6
  2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
                   ` (16 preceding siblings ...)
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 17/18] Ban einstall for " Michał Górny
@ 2014-12-01 21:28 ` Michał Górny
  17 siblings, 0 replies; 25+ messages in thread
From: Michał Górny @ 2014-12-01 21:28 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

---
 bin/eapi.sh               | 4 ++++
 bin/ebuild-helpers/dohtml | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index b27b57c..7e7b54b 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -52,6 +52,10 @@ ___eapi_has_einstall() {
 	[[ ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
 }
 
+___eapi_has_dohtml_deprecated() {
+	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
+}
+
 ___eapi_has_docompress() {
 	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3)$ ]]
 }
diff --git a/bin/ebuild-helpers/dohtml b/bin/ebuild-helpers/dohtml
index 75d3d00..0478e49 100755
--- a/bin/ebuild-helpers/dohtml
+++ b/bin/ebuild-helpers/dohtml
@@ -4,6 +4,10 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+if ___eapi_has_dohtml_deprecated; then
+	eqawarn "'${0##*/}' is deprecated in EAPI '$EAPI'"
+fi
+
 PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
 PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
 # Use safe cwd, avoiding unsafe import for bug #469338.
-- 
2.1.3



^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6 Michał Górny
@ 2015-01-16 10:14   ` Sergei Trofimovich
  2015-01-16 18:18     ` Zac Medico
  0 siblings, 1 reply; 25+ messages in thread
From: Sergei Trofimovich @ 2015-01-16 10:14 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: mgorny


[-- Attachment #1.1: Type: text/plain, Size: 1155 bytes --]

On Mon,  1 Dec 2014 22:28:34 +0100
Michał Górny <mgorny@gentoo.org> wrote:

> Disallow calling most of the ebuild helpers in global scope since they
> are meaningless in that context. Most of them are also prohibited by PMS
> for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
> that restriction.
> ---
>  bin/eapi.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/bin/eapi.sh b/bin/eapi.sh
> index e0ade02..5ab92f4 100644
> --- a/bin/eapi.sh
> +++ b/bin/eapi.sh
> @@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
>  }
>  
>  ___eapi_disallows_helpers_in_global_scope() {
> -	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
> +	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
>  }
>  
>  ___eapi_unpack_is_case_sensitive() {

Looks like it cries on ebuilds with unset EAPI in main tree (attached).
Can be easily fixed in tree by adding EAPI=0, but better handle it
here: ${EAPI-0} (untested!)

It also changed binutils: it used to be slotted only in presence of USE flag.
Now it's always slotted even with USE=-multislot (at least eix thinks so).

-- 

  Sergei

[-- Attachment #1.2: bad-log.txt --]
[-- Type: text/plain, Size: 23607 bytes --]

 ^[[31;01m*^[[0m ERROR: dev-java/ibm-jdk-bin-1.6.0.9_p1::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                       ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/dev-java/ibm-jdk-bin/ibm-jdk-bin-1.6.0.9_p1.ebuild'
 ^[[31;01m*^[[0m ERROR: dev-java/ibm-jdk-bin-1.6.0.9_p2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m   ibm-jdk-bin-1.6.0.9_p1.ebuild, line  50:  Called use 'x86'
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                       ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m                       ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/dev-java/ibm-jdk-bin/ibm-jdk-bin-1.6.0.9_p2.ebuild'
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m ERROR: dev-java/ibm-jre-bin-1.6.0.9_p1::gentoo failed (depend phase):
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m   ibm-jdk-bin-1.6.0.9_p2.ebuild, line  50:  Called use 'x86'
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=dev-java/ibm-jdk-bin-1.6.0.9_p1::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=dev-java/ibm-jdk-bin-1.6.0.9_p1::gentoo'`.
 ^[[31;01m*^[[0m                       ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m ERROR: dev-java/ibm-jre-bin-1.6.0.9_p2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/dev-java/ibm-jdk-bin-1.6.0.9_p1/work/ibm-jdk-bin-1.6.0.9_p1'
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=dev-java/ibm-jdk-bin-1.6.0.9_p2::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=dev-java/ibm-jdk-bin-1.6.0.9_p2::gentoo'`.
 ^[[31;01m*^[[0m                       ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/dev-java/ibm-jre-bin/ibm-jre-bin-1.6.0.9_p2.ebuild'
 ^[[31;01m*^[[0m                       ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/dev-java/ibm-jre-bin/ibm-jre-bin-1.6.0.9_p1.ebuild'
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/dev-java/ibm-jdk-bin-1.6.0.9_p2/work/ibm-jdk-bin-1.6.0.9_p2'
 ^[[31;01m*^[[0m   ibm-jre-bin-1.6.0.9_p2.ebuild, line  31:  Called use 'x86'
 ^[[31;01m*^[[0m   ibm-jre-bin-1.6.0.9_p1.ebuild, line  31:  Called use 'x86'
 ^[[31;01m*^[[0m                       ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m                       ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=dev-java/ibm-jre-bin-1.6.0.9_p2::gentoo'`,
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=dev-java/ibm-jre-bin-1.6.0.9_p1::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=dev-java/ibm-jre-bin-1.6.0.9_p2::gentoo'`.
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=dev-java/ibm-jre-bin-1.6.0.9_p1::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/dev-java/ibm-jre-bin-1.6.0.9_p2/work/ibm-jre-bin-1.6.0.9_p2'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/dev-java/ibm-jre-bin-1.6.0.9_p1/work/ibm-jre-bin-1.6.0.9_p1'
Error processing dev-java/ibm-jre-bin-1.6.0.9_p1, continuing...
Error processing dev-java/ibm-jre-bin-1.6.0.9_p2, continuing...
 ^[[31;01m*^[[0m ERROR: gpe-base/gpe-contacts-0.49::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use_enable() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                  ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/gpe-base/gpe-contacts/gpe-contacts-0.49.ebuild'
 ^[[31;01m*^[[0m   gpe-contacts-0.49.ebuild, line  16:  Called use_enable 'dbus'
 ^[[31;01m*^[[0m                  ebuild.sh, line  34:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=gpe-base/gpe-contacts-0.49::gentoo'`,
 ^[[31;01m*^[[0m ERROR: gpe-base/libgpevtype-0.50::gentoo failed (depend phase):
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=gpe-base/gpe-contacts-0.49::gentoo'`.
 ^[[31;01m*^[[0m   use_enable() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/gpe-base/gpe-contacts-0.49/work/gpe-contacts-0.49'
 ^[[31;01m*^[[0m                 ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/gpe-base/libgpevtype/libgpevtype-0.50.ebuild'
 ^[[31;01m*^[[0m ERROR: gpe-base/libeventdb-0.90::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use_enable() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m   libgpevtype-0.50.ebuild, line  15:  Called use_enable 'doc' 'gtk-doc'
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m ERROR: gpe-base/libmimedir-0.4.2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use_enable() calls are not allowed in global scope
 ^[[31;01m*^[[0m                 ebuild.sh, line  34:  Called die
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m   	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m                 ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/gpe-base/libmimedir/libmimedir-0.4.2.ebuild'
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=gpe-base/libgpevtype-0.50::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=gpe-base/libgpevtype-0.50::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m   libmimedir-0.4.2.ebuild, line  17:  Called use_enable 'doc' 'gtk-doc'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/gpe-base/libgpevtype-0.50/work/libgpevtype-0.50'
 ^[[31;01m*^[[0m                ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/gpe-base/libeventdb/libeventdb-0.90.ebuild'
 ^[[31;01m*^[[0m                 ebuild.sh, line  34:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   libeventdb-0.90.ebuild, line  16:  Called use_enable 'doc' 'gtk-doc'
 ^[[31;01m*^[[0m ERROR: gpe-base/libmimedir-0.4.3::gentoo failed (depend phase):
 ^[[31;01m*^[[0m                ebuild.sh, line  34:  Called die
 ^[[31;01m*^[[0m   	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   use_enable() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=gpe-base/libmimedir-0.4.2::gentoo'`,
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=gpe-base/libmimedir-0.4.2::gentoo'`.
 ^[[31;01m*^[[0m   	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=gpe-base/libeventdb-0.90::gentoo'`,
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/gpe-base/libmimedir-0.4.2/work/libmimedir-0.4.2'
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=gpe-base/libeventdb-0.90::gentoo'`.
 ^[[31;01m*^[[0m                 ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/gpe-base/libmimedir/libmimedir-0.4.3.ebuild'
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/gpe-base/libeventdb-0.90/work/libeventdb-0.90'
 ^[[31;01m*^[[0m   libmimedir-0.4.3.ebuild, line  17:  Called use_enable 'doc' 'gtk-doc'
 ^[[31;01m*^[[0m ERROR: gpe-base/libtododb-0.11::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use_enable() calls are not allowed in global scope
 ^[[31;01m*^[[0m                 ebuild.sh, line  34:  Called die
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m   	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=gpe-base/libmimedir-0.4.3::gentoo'`,
 ^[[31;01m*^[[0m               ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/gpe-base/libtododb/libtododb-0.11.ebuild'
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=gpe-base/libmimedir-0.4.3::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/gpe-base/libmimedir-0.4.3/work/libmimedir-0.4.3'
 ^[[31;01m*^[[0m   libtododb-0.11.ebuild, line  15:  Called use_enable 'doc' 'gtk-doc'
 ^[[31;01m*^[[0m               ebuild.sh, line  34:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These dummy functions return false in non-strict EAPIs, in order to ensure that
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=gpe-base/libtododb-0.11::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=gpe-base/libtododb-0.11::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/gpe-base/libtododb-0.11/work/libtododb-0.11'
Error processing dev-java/ibm-jdk-bin-1.6.0.9_p2, continuing...
Error processing dev-java/ibm-jdk-bin-1.6.0.9_p1, continuing...
Error processing gpe-base/libtododb-0.11, continuing...
Error processing gpe-base/libmimedir-0.4.3, continuing...
 ^[[31;01m*^[[0m ERROR: media-fonts/baekmuk-fonts-2.2-r2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                     ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/baekmuk-fonts/baekmuk-fonts-2.2-r2.ebuild'
Error processing gpe-base/libeventdb-0.90, continuing...
 ^[[31;01m*^[[0m   baekmuk-fonts-2.2-r2.ebuild, line   5:  Called inherit 'font' 'font-ebdftopcf'
 ^[[31;01m*^[[0m                     ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m                     ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m         font-ebdftopcf.eclass, line  20:  Called use 'X'
 ^[[31;01m*^[[0m                     ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
Error processing gpe-base/libmimedir-0.4.2, continuing...
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m ERROR: media-fonts/culmus-ancient-0.06.1::gentoo failed (depend phase):
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/baekmuk-fonts-2.2-r2::gentoo'`,
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/baekmuk-fonts-2.2-r2::gentoo'`.
 ^[[31;01m*^[[0m ERROR: media-fonts/efont-unicode-0.4.2-r1::gentoo failed (depend phase):
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/baekmuk-fonts-2.2-r2/work/baekmuk-fonts-2.2'
Error processing gpe-base/libgpevtype-0.50, continuing...
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                      ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/culmus-ancient/culmus-ancient-0.06.1.ebuild'
 ^[[31;01m*^[[0m   culmus-ancient-0.06.1.ebuild, line  25:  Called use 'fontforge'
 ^[[31;01m*^[[0m ERROR: media-fonts/culmus-ancient-0.05.1::gentoo failed (depend phase):
 ^[[31;01m*^[[0m                       ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/efont-unicode/efont-unicode-0.4.2-r1.ebuild'
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                      ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   efont-unicode-0.4.2-r1.ebuild, line   5:  Called inherit 'font' 'font-ebdftopcf'
 ^[[31;01m*^[[0m                      ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/culmus-ancient/culmus-ancient-0.05.1.ebuild'
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m   culmus-ancient-0.05.1.ebuild, line  25:  Called use 'fontforge'
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m                       ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/culmus-ancient-0.06.1::gentoo'`,
 ^[[31;01m*^[[0m                      ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/culmus-ancient-0.06.1::gentoo'`.
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m                       ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/culmus-ancient-0.05.1::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/culmus-ancient-0.05.1::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m           font-ebdftopcf.eclass, line  20:  Called use 'X'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/culmus-ancient-0.05.1/work/culmus-ancient-0.05.1'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/culmus-ancient-0.06.1/work/culmus-ancient-0.06.1'
 ^[[31;01m*^[[0m                       ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m ERROR: media-fonts/jisx0213-fonts-20040425-r2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/efont-unicode-0.4.2-r1::gentoo'`,
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/efont-unicode-0.4.2-r1::gentoo'`.
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/efont-unicode-0.4.2-r1/work/efont-unicode-0.4.2'
 ^[[31;01m*^[[0m                           ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/jisx0213-fonts/jisx0213-fonts-20040425-r2.ebuild'
 ^[[31;01m*^[[0m   jisx0213-fonts-20040425-r2.ebuild, line   5:  Called inherit 'font' 'font-ebdftopcf'
Error processing gpe-base/gpe-contacts-0.49, continuing...
 ^[[31;01m*^[[0m                           ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m                           ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m               font-ebdftopcf.eclass, line  20:  Called use 'X'
 ^[[31;01m*^[[0m                           ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m ERROR: media-fonts/lfpfonts-var-0.84::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/jisx0213-fonts-20040425-r2::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/jisx0213-fonts-20040425-r2::gentoo'`.
 ^[[31;01m*^[[0m                  ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/lfpfonts-var/lfpfonts-var-0.84.ebuild'
 ^[[31;01m*^[[0m ERROR: media-fonts/lfpfonts-fix-0.83-r2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/jisx0213-fonts-20040425-r2/work/jisx0213-fonts-20040425'
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m   lfpfonts-var-0.84.ebuild, line   5:  Called inherit 'font' 'font-ebdftopcf'
 ^[[31;01m*^[[0m                     ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/lfpfonts-fix/lfpfonts-fix-0.83-r2.ebuild'
 ^[[31;01m*^[[0m                  ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m   lfpfonts-fix-0.83-r2.ebuild, line   5:  Called inherit 'font' 'eutils' 'font-ebdftopcf'
 ^[[31;01m*^[[0m                  ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m      font-ebdftopcf.eclass, line  20:  Called use 'X'
 ^[[31;01m*^[[0m                     ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m                  ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m                     ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m         font-ebdftopcf.eclass, line  20:  Called use 'X'
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/lfpfonts-var-0.84::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/lfpfonts-var-0.84::gentoo'`.
 ^[[31;01m*^[[0m                     ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/lfpfonts-var-0.84/work/lfpfonts-var-0.84'
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/lfpfonts-fix-0.83-r2::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/lfpfonts-fix-0.83-r2::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/lfpfonts-fix-0.83-r2/work/lfpfonts-fix-0.83'
 ^[[31;01m*^[[0m ERROR: media-fonts/vc-fonts-20020207-r2::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                     ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/media-fonts/vc-fonts/vc-fonts-20020207-r2.ebuild'
 ^[[31;01m*^[[0m   vc-fonts-20020207-r2.ebuild, line   5:  Called inherit 'font' 'font-ebdftopcf'
 ^[[31;01m*^[[0m                     ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m                     ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/font-ebdftopcf.eclass'
 ^[[31;01m*^[[0m         font-ebdftopcf.eclass, line  20:  Called use 'X'
 ^[[31;01m*^[[0m                     ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=media-fonts/vc-fonts-20020207-r2::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=media-fonts/vc-fonts-20020207-r2::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/media-fonts/vc-fonts-20020207-r2/work/vc-fonts-20020207'
Error processing media-fonts/vc-fonts-20020207-r2, continuing...
 ^[[31;01m*^[[0m ERROR: sys-devel/binutils-2.24-r3::gentoo failed (depend phase):
 ^[[31;01m*^[[0m   use() calls are not allowed in global scope
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m                   ebuild.sh, line 584:  Called source '/gentoo-32k/gentoo-x86/sys-devel/binutils/binutils-2.24-r3.ebuild'
 ^[[31;01m*^[[0m     binutils-2.24-r3.ebuild, line   7:  Called inherit 'toolchain-binutils'
 ^[[31;01m*^[[0m                   ebuild.sh, line 280:  Called __qa_source '/gentoo-32k/gentoo-x86/eclass/toolchain-binutils.eclass'
 ^[[31;01m*^[[0m                   ebuild.sh, line  80:  Called source '/gentoo-32k/gentoo-x86/eclass/toolchain-binutils.eclass'
 ^[[31;01m*^[[0m   toolchain-binutils.eclass, line 106:  Called use 'multislot'
 ^[[31;01m*^[[0m                   ebuild.sh, line  47:  Called die
 ^[[31;01m*^[[0m The specific snippet of code:
 ^[[31;01m*^[[0m   	# These functions die because calls to them during the "depend" phase
 ^[[31;01m*^[[0m 
 ^[[31;01m*^[[0m If you need support, post the output of `emerge --info '=sys-devel/binutils-2.24-r3::gentoo'`,
 ^[[31;01m*^[[0m the complete build log and the output of `emerge -pqv '=sys-devel/binutils-2.24-r3::gentoo'`.
 ^[[31;01m*^[[0m Working directory: '/usr/lib64/python3.3/site-packages'
 ^[[31;01m*^[[0m S: '/tmp/portage-tmpdir/portage/sys-devel/binutils-2.24-r3/work/binutils-2.24'
Error processing media-fonts/lfpfonts-fix-0.83-r2, continuing...
Error processing media-fonts/lfpfonts-var-0.84, continuing...
Error processing media-fonts/jisx0213-fonts-20040425-r2, continuing...
Error processing media-fonts/efont-unicode-0.4.2-r1, continuing...
Error processing media-fonts/culmus-ancient-0.06.1, continuing...
Error processing media-fonts/culmus-ancient-0.05.1, continuing...
Error processing media-fonts/baekmuk-fonts-2.2-r2, continuing...
Error processing sys-devel/binutils-2.24-r3, continuing...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6
  2015-01-16 10:14   ` Sergei Trofimovich
@ 2015-01-16 18:18     ` Zac Medico
  2015-01-16 19:53       ` Zac Medico
  0 siblings, 1 reply; 25+ messages in thread
From: Zac Medico @ 2015-01-16 18:18 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: mgorny

On 01/16/2015 02:14 AM, Sergei Trofimovich wrote:
> On Mon,  1 Dec 2014 22:28:34 +0100
> Michał Górny <mgorny@gentoo.org> wrote:
> 
>> Disallow calling most of the ebuild helpers in global scope since they
>> are meaningless in that context. Most of them are also prohibited by PMS
>> for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
>> that restriction.
>> ---
>>  bin/eapi.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bin/eapi.sh b/bin/eapi.sh
>> index e0ade02..5ab92f4 100644
>> --- a/bin/eapi.sh
>> +++ b/bin/eapi.sh
>> @@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
>>  }
>>  
>>  ___eapi_disallows_helpers_in_global_scope() {
>> -	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
>> +	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
>>  }
>>  
>>  ___eapi_unpack_is_case_sensitive() {
> 
> Looks like it cries on ebuilds with unset EAPI in main tree (attached).
> Can be easily fixed in tree by adding EAPI=0, but better handle it
> here: ${EAPI-0} (untested!)

Using ${EAPI-0} would not be the correct fix, because portage is
supposed to export the EAPI that was previously determined via the
_parse_eapi_ebuild_head function (preprocessor).
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6
  2015-01-16 18:18     ` Zac Medico
@ 2015-01-16 19:53       ` Zac Medico
  0 siblings, 0 replies; 25+ messages in thread
From: Zac Medico @ 2015-01-16 19:53 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: mgorny

On 01/16/2015 10:18 AM, Zac Medico wrote:
> On 01/16/2015 02:14 AM, Sergei Trofimovich wrote:
>> On Mon,  1 Dec 2014 22:28:34 +0100
>> Michał Górny <mgorny@gentoo.org> wrote:
>>
>>> Disallow calling most of the ebuild helpers in global scope since they
>>> are meaningless in that context. Most of them are also prohibited by PMS
>>> for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
>>> that restriction.
>>> ---
>>>  bin/eapi.sh | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/bin/eapi.sh b/bin/eapi.sh
>>> index e0ade02..5ab92f4 100644
>>> --- a/bin/eapi.sh
>>> +++ b/bin/eapi.sh
>>> @@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
>>>  }
>>>  
>>>  ___eapi_disallows_helpers_in_global_scope() {
>>> -	[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
>>> +	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
>>>  }
>>>  
>>>  ___eapi_unpack_is_case_sensitive() {
>>
>> Looks like it cries on ebuilds with unset EAPI in main tree (attached).
>> Can be easily fixed in tree by adding EAPI=0, but better handle it
>> here: ${EAPI-0} (untested!)
> 
> Using ${EAPI-0} would not be the correct fix, because portage is
> supposed to export the EAPI that was previously determined via the
> _parse_eapi_ebuild_head function (preprocessor).

Actually, ebuild.sh unsets the EAPI just before it sources the ebuild,
and then it does this after it sources the ebuild:

  [ "${EAPI+set}" = set ] || EAPI=0

So, for any code that is called while the ebuild is being sourced, using
${EAPI-0} would be correct.
-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function
  2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function Michał Górny
@ 2017-02-09 22:39   ` Zac Medico
  2017-02-10 13:57     ` Michał Górny
  0 siblings, 1 reply; 25+ messages in thread
From: Zac Medico @ 2017-02-09 22:39 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

On 12/01/2014 01:28 PM, Michał Górny wrote:
> Add support for the user patch applying function.
> ---
>  bin/eapi.sh          |  4 ++++
>  bin/phase-helpers.sh | 22 ++++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/bin/eapi.sh b/bin/eapi.sh
> index 8ffffbb..6e78750 100644
> --- a/bin/eapi.sh
> +++ b/bin/eapi.sh
> @@ -76,6 +76,10 @@ ___eapi_has_eapply() {
>  	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
>  }
>  
> +___eapi_has_eapply_user() {
> +	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
> +}
> +
>  ___eapi_has_master_repositories() {
>  	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
>  }
> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
> index e9fbbb4..f4b64ee 100644
> --- a/bin/phase-helpers.sh
> +++ b/bin/phase-helpers.sh
> @@ -986,6 +986,28 @@ if ___eapi_has_eapply; then
>  	}
>  fi
>  
> +if ___eapi_has_eapply_user; then
> +	eapply_user() {
> +		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
> +
> +		local d applied
> +		# possibilities:
> +		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
> +		#    ${P} twice)
> +		# 2. ${CATEGORY}/${P}
> +		# 3. ${CATEGORY}/${PN}
> +		# all of the above may be optionally followed by a slot
> +		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
> +			if [[ -d ${d} ]]; then
> +				eapply "${d}"
> +				applied=1

I think it should break out of the loop here, like epatch_user does.

It doesn't make sense to apply more-specific patches before
less-specific patches, does it?

Maybe we can just treat this as a bug fix? Is anyone relying on the
multiple directory usage?

> +			fi
> +		done
> +
> +		[[ -n ${applied} ]] && ewarn "User patches applied."
> +	}
> +fi
> +
>  if ___eapi_has_master_repositories; then
>  	master_repositories() {
>  		local output repository=$1 retval
> 


-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function
  2017-02-09 22:39   ` Zac Medico
@ 2017-02-10 13:57     ` Michał Górny
  2017-02-10 16:57       ` Zac Medico
  0 siblings, 1 reply; 25+ messages in thread
From: Michał Górny @ 2017-02-10 13:57 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 2701 bytes --]

W dniu 09.02.2017, czw o godzinie 14∶39 -0800, użytkownik Zac Medico
napisał:
> On 12/01/2014 01:28 PM, Michał Górny wrote:
> > Add support for the user patch applying function.
> > ---
> >  bin/eapi.sh          |  4 ++++
> >  bin/phase-helpers.sh | 22 ++++++++++++++++++++++
> >  2 files changed, 26 insertions(+)
> > 
> > diff --git a/bin/eapi.sh b/bin/eapi.sh
> > index 8ffffbb..6e78750 100644
> > --- a/bin/eapi.sh
> > +++ b/bin/eapi.sh
> > @@ -76,6 +76,10 @@ ___eapi_has_eapply() {
> >  	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
> >  }
> >  
> > +___eapi_has_eapply_user() {
> > +	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
> > +}
> > +
> >  ___eapi_has_master_repositories() {
> >  	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
> >  }
> > diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
> > index e9fbbb4..f4b64ee 100644
> > --- a/bin/phase-helpers.sh
> > +++ b/bin/phase-helpers.sh
> > @@ -986,6 +986,28 @@ if ___eapi_has_eapply; then
> >  	}
> >  fi
> >  
> > +if ___eapi_has_eapply_user; then
> > +	eapply_user() {
> > +		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
> > +
> > +		local d applied
> > +		# possibilities:
> > +		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
> > +		#    ${P} twice)
> > +		# 2. ${CATEGORY}/${P}
> > +		# 3. ${CATEGORY}/${PN}
> > +		# all of the above may be optionally followed by a slot
> > +		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
> > +			if [[ -d ${d} ]]; then
> > +				eapply "${d}"
> > +				applied=1
> 
> I think it should break out of the loop here, like epatch_user does.

As the comment above suggests, it was intentional that all directories
are used.

> It doesn't make sense to apply more-specific patches before
> less-specific patches, does it?

Maybe. It would probably be most reasonable to sort them all by
filename, and apply in that order. Also allowing patch with the same
filename to override/skip patch from less specific directory.

> Maybe we can just treat this as a bug fix? Is anyone relying on the
> multiple directory usage?

That sounds like a major behavior change for a 'fix'. I'm using multiple
directories though it's all pretty much a workaround solution, so I
guess it doesn't matter if we keep it stable.

> 
> > +			fi
> > +		done
> > +
> > +		[[ -n ${applied} ]] && ewarn "User patches applied."
> > +	}
> > +fi
> > +
> >  if ___eapi_has_master_repositories; then
> >  	master_repositories() {
> >  		local output repository=$1 retval
> > 
> 
> 

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function
  2017-02-10 13:57     ` Michał Górny
@ 2017-02-10 16:57       ` Zac Medico
  0 siblings, 0 replies; 25+ messages in thread
From: Zac Medico @ 2017-02-10 16:57 UTC (permalink / raw
  To: gentoo-portage-dev

On 02/10/2017 05:57 AM, Michał Górny wrote:
> W dniu 09.02.2017, czw o godzinie 14∶39 -0800, użytkownik Zac Medico
> napisał:
>> On 12/01/2014 01:28 PM, Michał Górny wrote:
>>> Add support for the user patch applying function.
>>> ---
>>>  bin/eapi.sh          |  4 ++++
>>>  bin/phase-helpers.sh | 22 ++++++++++++++++++++++
>>>  2 files changed, 26 insertions(+)
>>>
>>> diff --git a/bin/eapi.sh b/bin/eapi.sh
>>> index 8ffffbb..6e78750 100644
>>> --- a/bin/eapi.sh
>>> +++ b/bin/eapi.sh
>>> @@ -76,6 +76,10 @@ ___eapi_has_eapply() {
>>>  	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
>>>  }
>>>  
>>> +___eapi_has_eapply_user() {
>>> +	[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress)$ ]]
>>> +}
>>> +
>>>  ___eapi_has_master_repositories() {
>>>  	[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
>>>  }
>>> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
>>> index e9fbbb4..f4b64ee 100644
>>> --- a/bin/phase-helpers.sh
>>> +++ b/bin/phase-helpers.sh
>>> @@ -986,6 +986,28 @@ if ___eapi_has_eapply; then
>>>  	}
>>>  fi
>>>  
>>> +if ___eapi_has_eapply_user; then
>>> +	eapply_user() {
>>> +		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
>>> +
>>> +		local d applied
>>> +		# possibilities:
>>> +		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
>>> +		#    ${P} twice)
>>> +		# 2. ${CATEGORY}/${P}
>>> +		# 3. ${CATEGORY}/${PN}
>>> +		# all of the above may be optionally followed by a slot
>>> +		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
>>> +			if [[ -d ${d} ]]; then
>>> +				eapply "${d}"
>>> +				applied=1
>>
>> I think it should break out of the loop here, like epatch_user does.
> 
> As the comment above suggests, it was intentional that all directories
> are used.
> 
>> It doesn't make sense to apply more-specific patches before
>> less-specific patches, does it?
> 
> Maybe. It would probably be most reasonable to sort them all by
> filename, and apply in that order. Also allowing patch with the same
> filename to override/skip patch from less specific directory.

Yeah that sounds good. If we do that then it will be roughly compatible
with the existing behavior, so if we're lucky then nobody will complain.
I've filed a corresponding feature request bug:

https://bugs.gentoo.org/show_bug.cgi?id=608880

>> Maybe we can just treat this as a bug fix? Is anyone relying on the
>> multiple directory usage?
> 
> That sounds like a major behavior change for a 'fix'. I'm using multiple
> directories though it's all pretty much a workaround solution, so I
> guess it doesn't matter if we keep it stable.

If we wanted to disable the multi directory support, I guess we could
make it trigger an ewarn message before we really change the behavior,
but I think I like the sorting/override/skip idea better.

>>
>>> +			fi
>>> +		done
>>> +
>>> +		[[ -n ${applied} ]] && ewarn "User patches applied."
>>> +	}
>>> +fi
>>> +
>>>  if ___eapi_has_master_repositories; then
>>>  	master_repositories() {
>>>  		local output repository=$1 retval
>>>
>>
>>
> 


-- 
Thanks,
Zac


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2017-02-10 16:57 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01 21:28 [gentoo-portage-dev] [PATCH 00/18] Updated EAPI 6 patch set Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 01/18] Respect nonfatal in unpack(), econf() and einstall() Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 02/18] Apply 'nonfatal' to helpers only Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 03/18] Support EAPI=6_pre1 for testing EAPI6 features Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 04/18] Add tentative support for EAPI6 --docdir and --htmldir Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 05/18] Add tentative support for EAPI6 get_libdir() Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 06/18] Add tentative support for EAPI6 einstalldocs function Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 07/18] Add tentative support for EAPI6 eapply function Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 08/18] Add tentative support for EAPI6 eapply_user function Michał Górny
2017-02-09 22:39   ` Zac Medico
2017-02-10 13:57     ` Michał Górny
2017-02-10 16:57       ` Zac Medico
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 09/18] Enable tentative EAPI6 failglob in global scope Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 10/18] Enable tentative support for EAPI6 profile-level directories Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 11/18] Add tentative EAPI6 .txz unpack support Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 12/18] Add tentative EAPI6 absolute path support to unpack() Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 13/18] Add tentative EAPI6 nonfatal support to die() Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 14/18] Add tentative EAPI6 in_iuse() function Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 15/18] Add tentative EAPI6 phase functions Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6 Michał Górny
2015-01-16 10:14   ` Sergei Trofimovich
2015-01-16 18:18     ` Zac Medico
2015-01-16 19:53       ` Zac Medico
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 17/18] Ban einstall for " Michał Górny
2014-12-01 21:28 ` [gentoo-portage-dev] [PATCH 18/18] Deprecate dohtml " Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox