public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support
@ 2015-11-28 13:24 Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
                   ` (8 more replies)
  0 siblings, 9 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

The main new feature is the introduction of virtx(). This function executes
the arguments inside a Xfvb context in contrast to the deprecated
virtualmake which required to set VIRTUALX_COMMAND, which then gets
executed.

Xemake and Xeconf should be converted to "virtx emake" and "virtx econf",
respectively.

Justin Lecher (8):
  virtualx.eclass: Use case/esac to handle supported EAPIs
  virtualx.eclass: Only source eclas once
  virtualx.eclass: Use eqawarn instead of ewarn "QA:..."
  virtualx.eclass: Ban deprecated functionality in EAPI > 5
  virtualx.eclass: Support EAPI=6
  virtualx.eclass: Whitespace cleanup
  virtualx.eclass: Add missing die
  virtualx.eclass: Simplify API into single virtx()

 eclass/virtualx.eclass | 87 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 65 insertions(+), 22 deletions(-)

-- 
2.6.3



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

* [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 14:46   ` Davide Pesavento
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 5d27ed9..584fb29 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -9,6 +9,17 @@
 # Original author: Martin Schlemmer <azarah@gentoo.org>
 # @BLURB: This eclass can be used for packages that needs a working X environment to build.
 
+case "${EAPI:-0}" in
+	0|1)
+		die "virtualx eclass require EAPI=2 or newer."
+		;;
+	2|3|4|5)
+		;;
+	*)
+		die "EAPI ${EAPI} is not supported yet."
+		;;
+esac
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -35,7 +46,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
 # (within virtualmake function).
 : ${VIRTUALX_COMMAND:="emake"}
 
-has "${EAPI:-0}" 0 1 && die "virtualx eclass require EAPI=2 or newer."
 
 case ${VIRTUALX_REQUIRED} in
 	manual)
-- 
2.6.3



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

* [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 584fb29..0b6614a 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -20,6 +20,8 @@ case "${EAPI:-0}" in
 		;;
 esac
 
+if [[ ! ${_VIRTUAL_X} ]]; then
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -195,3 +197,6 @@ Xeconf() {
 
 	VIRTUALX_COMMAND="econf" virtualmake "$@"
 }
+
+_VIRTUAL_X=1
+fi
-- 
2.6.3



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

* [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..."
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 0b6614a..a7f17ec 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -22,6 +22,8 @@ esac
 
 if [[ ! ${_VIRTUAL_X} ]]; then
 
+inherit eutils
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -58,15 +60,15 @@ case ${VIRTUALX_REQUIRED} in
 		;;
 	optional|tests)
 		# deprecated section YAY.
-		ewarn "QA: VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
-		ewarn "QA: You can drop the variable definition completely from ebuild,"
-		ewarn "QA: because it is default behaviour."
+		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
+		eqawarn "You can drop the variable definition completely from ebuild,"
+		eqawarn "because it is default behaviour."
 
 		if [[ -n ${VIRTUALX_USE} ]]; then
 			# so they like to specify the useflag
-			ewarn "QA: VIRTUALX_USE variable is deprecated."
-			ewarn "QA: Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
-			ewarn "QA: to achieve the same behaviour."
+			eqawarn "VIRTUALX_USE variable is deprecated."
+			eqawarn "Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
+			eqawarn "to achieve the same behaviour."
 		fi
 
 		[[ -z ${VIRTUALX_USE} ]] && VIRTUALX_USE="test"
@@ -97,9 +99,9 @@ virtualmake() {
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
-		ewarn "QA: ebuild is exporting \$maketype=${maketype}"
-		ewarn "QA: Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
-		ewarn "QA: Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
+		eqawarn "ebuild is exporting \$maketype=${maketype}"
+		eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
+		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
 		VIRTUALX_COMMAND=${maketype}
 	fi
 
@@ -175,8 +177,8 @@ virtualmake() {
 Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	ewarn "QA: you should not execute make directly"
-	ewarn "QA: rather execute Xemake -j1 if you have issues with parallel make"
+	eqawarn "you should not execute make directly"
+	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
 }
 
-- 
2.6.3



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

* [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
                   ` (2 preceding siblings ...)
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 14:03   ` Michał Górny
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Support EAPI=6 Justin Lecher
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index a7f17ec..615ff0e 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -59,6 +59,7 @@ case ${VIRTUALX_REQUIRED} in
 		RDEPEND=""
 		;;
 	optional|tests)
+		[[ ${EAPI} == [2345] ]] || die 'Values "optional" and "tests" are unsupported for VIRTUALX_REQUIRED'
 		# deprecated section YAY.
 		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
 		eqawarn "You can drop the variable definition completely from ebuild,"
@@ -177,6 +178,9 @@ virtualmake() {
 Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
+
 	eqawarn "you should not execute make directly"
 	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
-- 
2.6.3



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

* [gentoo-dev] [PATCH 5/8] virtualx.eclass: Support EAPI=6
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
                   ` (3 preceding siblings ...)
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Whitespace cleanup Justin Lecher
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 615ff0e..048359f 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -13,7 +13,7 @@ case "${EAPI:-0}" in
 	0|1)
 		die "virtualx eclass require EAPI=2 or newer."
 		;;
-	2|3|4|5)
+	2|3|4|5|6)
 		;;
 	*)
 		die "EAPI ${EAPI} is not supported yet."
-- 
2.6.3



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

* [gentoo-dev] [PATCH 6/8] virtualx.eclass: Whitespace cleanup
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
                   ` (4 preceding siblings ...)
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Support EAPI=6 Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Add missing die Justin Lecher
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 1 -
 1 file changed, 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 048359f..54514b0 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -50,7 +50,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
 # (within virtualmake function).
 : ${VIRTUALX_COMMAND:="emake"}
 
-
 case ${VIRTUALX_REQUIRED} in
 	manual)
 		;;
-- 
2.6.3



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

* [gentoo-dev] [PATCH 7/8] virtualx.eclass: Add missing die
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
                   ` (5 preceding siblings ...)
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Whitespace cleanup Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
  2015-11-28 14:02 ` [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Michał Górny
  8 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 54514b0..f9fa879 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -93,9 +93,10 @@ virtualmake() {
 	local i=0
 	local retval=0
 	local OLD_SANDBOX_ON="${SANDBOX_ON}"
-	local XVFB=$(type -p Xvfb)
-	local XHOST=$(type -p xhost)
+	local XVFB XHOST XDISPLAY
 	local xvfbargs="-screen 0 1280x1024x24"
+	XVFB=$(type -p Xvfb) || die
+	XHOST=$(type -p xhost) || die
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
-- 
2.6.3



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

* [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
                   ` (6 preceding siblings ...)
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Add missing die Justin Lecher
@ 2015-11-28 13:24 ` Justin Lecher
  2015-11-28 15:28   ` Davide Pesavento
  2015-11-28 14:02 ` [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Michał Górny
  8 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 13:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

The new API runs all specified arguments to virtx() inside an XFVB,
instead of defining VIRTUALX_COMMAND and running that in virtualmake.

Xemake and Xeconf should be replaced by "virtx emake" and "virtx econf".

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index f9fa879..ca6a1f9 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -90,22 +90,38 @@ esac
 virtualmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	local i=0
-	local retval=0
-	local OLD_SANDBOX_ON="${SANDBOX_ON}"
-	local XVFB XHOST XDISPLAY
-	local xvfbargs="-screen 0 1280x1024x24"
-	XVFB=$(type -p Xvfb) || die
-	XHOST=$(type -p xhost) || die
+	[[ ${EAPI} == [2345] ]] || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
+		[[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5"
 		eqawarn "ebuild is exporting \$maketype=${maketype}"
 		eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
 		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
 		VIRTUALX_COMMAND=${maketype}
 	fi
 
+	virtx "${VIRTUALX_COMMAND}" "${@}"
+}
+
+
+# @FUNCTION: virtx
+# @USAGE: <command> [comman arguments]
+# @DESCRIPTION:
+# Function which start new Xvfb session where the command gets executed.
+virtx() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	[[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument"
+
+	local i=0
+	local retval=0
+	local OLD_SANDBOX_ON="${SANDBOX_ON}"
+	local XVFB XHOST XDISPLAY
+	local xvfbargs="-screen 0 1280x1024x24"
+	XVFB=$(type -p Xvfb) || die
+	XHOST=$(type -p xhost) || die
+
 	debug-print "${FUNCNAME}: running Xvfb hack"
 	export XAUTHORITY=
 	# The following is derived from Mandrake's hack to allow
@@ -155,10 +171,10 @@ virtualmake() {
 	# to kill Xvfb
 	debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\""
 	if has "${EAPI}" 2 3; then
-		${VIRTUALX_COMMAND} "$@"
+		"$@"
 		retval=$?
 	else
-		nonfatal ${VIRTUALX_COMMAND} "$@"
+		nonfatal "$@"
 		retval=$?
 	fi
 
@@ -179,7 +195,7 @@ Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	[[ ${EAPI} == [2345] ]] \
-		|| die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
 
 	eqawarn "you should not execute make directly"
 	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
@@ -192,6 +208,9 @@ Xmake() {
 Xemake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
+
 	VIRTUALX_COMMAND="emake" virtualmake "$@"
 }
 
@@ -201,6 +220,9 @@ Xemake() {
 Xeconf() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
+
 	VIRTUALX_COMMAND="econf" virtualmake "$@"
 }
 
-- 
2.6.3



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

* Re: [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support
  2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
                   ` (7 preceding siblings ...)
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
@ 2015-11-28 14:02 ` Michał Górny
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
  8 siblings, 1 reply; 39+ messages in thread
From: Michał Górny @ 2015-11-28 14:02 UTC (permalink / raw
  To: gentoo-dev, Justin Lecher; +Cc: Justin Lecher



Dnia 28 listopada 2015 14:24:13 CET, Justin Lecher <jlec@gentoo.org> napisał(a):
>The main new feature is the introduction of virtx(). This function
>executes
>the arguments inside a Xfvb context in contrast to the deprecated
>virtualmake which required to set VIRTUALX_COMMAND, which then gets
>executed.
>
>Xemake and Xeconf should be converted to "virtx emake" and "virtx
>econf",
>respectively.
>
>Justin Lecher (8):
>  virtualx.eclass: Use case/esac to handle supported EAPIs
>  virtualx.eclass: Only source eclas once
>  virtualx.eclass: Use eqawarn instead of ewarn "QA:..."
>  virtualx.eclass: Ban deprecated functionality in EAPI > 5
>  virtualx.eclass: Support EAPI=6
>  virtualx.eclass: Whitespace cleanup
>  virtualx.eclass: Add missing die
>  virtualx.eclass: Simplify API into single virtx()
>
>eclass/virtualx.eclass | 87
>+++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 65 insertions(+), 22 deletions(-)

Generally looks good, though i would reorder the patches so they make more sense alone. Like add new API first, then deprecate old, then ban it all, then enable 6.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


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

* Re: [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
@ 2015-11-28 14:03   ` Michał Górny
  2015-11-28 14:08     ` Justin Lecher (jlec)
  0 siblings, 1 reply; 39+ messages in thread
From: Michał Górny @ 2015-11-28 14:03 UTC (permalink / raw
  To: gentoo-dev, Justin Lecher; +Cc: Justin Lecher



Dnia 28 listopada 2015 14:24:17 CET, Justin Lecher <jlec@gentoo.org> napisał(a):
>Signed-off-by: Justin Lecher <jlec@gentoo.org>
>---
> eclass/virtualx.eclass | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
>index a7f17ec..615ff0e 100644
>--- a/eclass/virtualx.eclass
>+++ b/eclass/virtualx.eclass
>@@ -59,6 +59,7 @@ case ${VIRTUALX_REQUIRED} in
> 		RDEPEND=""
> 		;;
> 	optional|tests)
>+		[[ ${EAPI} == [2345] ]] || die 'Values "optional" and "tests" are
>unsupported for VIRTUALX_REQUIRED'

You can now make eutils conditional to EAPI.

> 		# deprecated section YAY.
>		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are
>deprecated."
>		eqawarn "You can drop the variable definition completely from
>ebuild,"
>@@ -177,6 +178,9 @@ virtualmake() {
> Xmake() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	[[ ${EAPI} == [2345] ]] \
>+		|| die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
>+
> 	eqawarn "you should not execute make directly"
>	eqawarn "rather execute Xemake -j1 if you have issues with parallel
>make"
> 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


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

* Re: [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 14:03   ` Michał Górny
@ 2015-11-28 14:08     ` Justin Lecher (jlec)
  2015-11-28 15:57       ` Michał Górny
  0 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher (jlec) @ 2015-11-28 14:08 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 28/11/15 15:03, Michał Górny wrote:
> 
> 
> Dnia 28 listopada 2015 14:24:17 CET, Justin Lecher
> <jlec@gentoo.org> napisał(a):
>> Signed-off-by: Justin Lecher <jlec@gentoo.org> --- 
>> eclass/virtualx.eclass | 4 ++++ 1 file changed, 4 insertions(+)
>> 
>> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass 
>> index a7f17ec..615ff0e 100644 --- a/eclass/virtualx.eclass +++
>> b/eclass/virtualx.eclass @@ -59,6 +59,7 @@ case
>> ${VIRTUALX_REQUIRED} in RDEPEND="" ;; optional|tests) +		[[
>> ${EAPI} == [2345] ]] || die 'Values "optional" and "tests" are 
>> unsupported for VIRTUALX_REQUIRED'
> 
> You can now make eutils conditional to EAPI.

So your idea is only import eutils for EAPIs where I will need eqawarn
from an eclass? As we have no ETA for that to change, I don't see a
good reason to fix that inherit right now.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0

iQJ8BAEBCgBmBQJWWbV0XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0QUU0N0I4NzFERUI0MTJFN0EyODE0NUFF
OTQwMkE3OUIwMzUyOUEyAAoJEOlAKnmwNSmiyCoP/3KdY8bSc6sw89Rs2xxl1wOo
iZX3dFjq8ya8xd2AU4uMoFyJY/SitAl+/dtcmRGloirZ7o/Y7YT2/Z6s1G+GCqOe
fXfivtGTGcGivI7F2Rs4ls8xtS3d4TWUKDR5R70kF8MMSNd+fxTtscqBUSQw8sJb
g1nzUeNFgylUraGsCUGXTrXoPzaFRQYNCipufI4JuvL90Agr8PC6v4TsgKew9WO+
MM/R4YnpFxubF2zw4m5qbIdbn28FVGg0mbuDc/QFLFhNApevMJacQG783k1f1TDJ
99Gj+pPj2TgfyVVnhJYvE7s05v8vmrecX//TOvvdKYXEjoB0IR/pyAtr3rOWF+M5
VjFWL3rfeZbKOEeQ52fRfzidOxR/thBZp/flZoJKLZmJ7baBewkpVGt+4d1KwZCM
/KRm/1snnZY5GnspH/zxa/MI+azNWkjKKS7PW2zbNwBWQ56aiAcA4vBkBfEBfqoR
NbRFyrBm7eEEjIwRHYj5SJuTMd236gnuXEQWeAU5o8HNnh2qiVHjdHnaF4ld/QIo
0n7DYDeJqBeF8D274Ubd4KrQMH9LE2WbKZgNfBxpJdqPRBP6FJhvAtTQW1iqXNpt
O4Lp9FO2jiP54Q6GWYmE8s1R2D1dXbTL10PmhGOec4tRWcrMAo5nlIwriezhHnKL
NAEsc1lyU5vHp9OGwcjX
=yI1e
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
@ 2015-11-28 14:46   ` Davide Pesavento
  0 siblings, 0 replies; 39+ messages in thread
From: Davide Pesavento @ 2015-11-28 14:46 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

On Sat, Nov 28, 2015 at 2:24 PM, Justin Lecher <jlec@gentoo.org> wrote:
> Signed-off-by: Justin Lecher <jlec@gentoo.org>
> ---
>  eclass/virtualx.eclass | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
> index 5d27ed9..584fb29 100644
> --- a/eclass/virtualx.eclass
> +++ b/eclass/virtualx.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2012 Gentoo Foundation
> +# Copyright 1999-2015 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
>  # $Id$
>
> @@ -9,6 +9,17 @@
>  # Original author: Martin Schlemmer <azarah@gentoo.org>
>  # @BLURB: This eclass can be used for packages that needs a working X environment to build.
>
> +case "${EAPI:-0}" in
> +       0|1)
> +               die "virtualx eclass require EAPI=2 or newer."

require -> requires

[nitpicking, feel free to ignore] Technically "2 or newer" is not
correct and not future-proof. You can rephrase to something like
"virtualx.eclass: EAPI ${EAPI} is too old".


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

* Re: [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-28 13:24 ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
@ 2015-11-28 15:28   ` Davide Pesavento
  2015-11-28 15:50     ` Justin Lecher (jlec)
  0 siblings, 1 reply; 39+ messages in thread
From: Davide Pesavento @ 2015-11-28 15:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

On Sat, Nov 28, 2015 at 2:24 PM, Justin Lecher <jlec@gentoo.org> wrote:
> The new API runs all specified arguments to virtx() inside an XFVB,
> instead of defining VIRTUALX_COMMAND and running that in virtualmake.
>
> Xemake and Xeconf should be replaced by "virtx emake" and "virtx econf".
>
> Signed-off-by: Justin Lecher <jlec@gentoo.org>
> ---
>  eclass/virtualx.eclass | 42 ++++++++++++++++++++++++++++++++----------
>  1 file changed, 32 insertions(+), 10 deletions(-)
>
> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
> index f9fa879..ca6a1f9 100644
> --- a/eclass/virtualx.eclass
> +++ b/eclass/virtualx.eclass
> @@ -90,22 +90,38 @@ esac
>  virtualmake() {
>         debug-print-function ${FUNCNAME} "$@"
>
> -       local i=0
> -       local retval=0
> -       local OLD_SANDBOX_ON="${SANDBOX_ON}"
> -       local XVFB XHOST XDISPLAY
> -       local xvfbargs="-screen 0 1280x1024x24"
> -       XVFB=$(type -p Xvfb) || die
> -       XHOST=$(type -p xhost) || die
> +       [[ ${EAPI} == [2345] ]] || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
>
>         # backcompat for maketype
>         if [[ -n ${maketype} ]]; then
> +               [[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5"
>                 eqawarn "ebuild is exporting \$maketype=${maketype}"
>                 eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
>                 eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
>                 VIRTUALX_COMMAND=${maketype}
>         fi
>
> +       virtx "${VIRTUALX_COMMAND}" "${@}"
> +}
> +
> +
> +# @FUNCTION: virtx
> +# @USAGE: <command> [comman arguments]

typo comman -> command

> +# @DESCRIPTION:
> +# Function which start new Xvfb session where the command gets executed.

I'd drop "Function which" from the description.

> +virtx() {
> +       debug-print-function ${FUNCNAME} "$@"
> +
> +       [[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument"
> +
> +       local i=0
> +       local retval=0
> +       local OLD_SANDBOX_ON="${SANDBOX_ON}"
> +       local XVFB XHOST XDISPLAY
> +       local xvfbargs="-screen 0 1280x1024x24"
> +       XVFB=$(type -p Xvfb) || die
> +       XHOST=$(type -p xhost) || die
> +
>         debug-print "${FUNCNAME}: running Xvfb hack"
>         export XAUTHORITY=
>         # The following is derived from Mandrake's hack to allow
> @@ -155,10 +171,10 @@ virtualmake() {
>         # to kill Xvfb
>         debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\""
>         if has "${EAPI}" 2 3; then
> -               ${VIRTUALX_COMMAND} "$@"
> +               "$@"
>                 retval=$?
>         else
> -               nonfatal ${VIRTUALX_COMMAND} "$@"
> +               nonfatal "$@"

Please take the opportunity to clean this up, possibly only in EAPI=6
if you don't want to risk breaking existing ebuilds. See bug 517976
for details.

>                 retval=$?
>         fi
>
> @@ -179,7 +195,7 @@ Xmake() {
>         debug-print-function ${FUNCNAME} "$@"
>
>         [[ ${EAPI} == [2345] ]] \
> -               || die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
> +               || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
>
>         eqawarn "you should not execute make directly"
>         eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
> @@ -192,6 +208,9 @@ Xmake() {
>  Xemake() {
>         debug-print-function ${FUNCNAME} "$@"
>
> +       [[ ${EAPI} == [2345] ]] \
> +               || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
> +
>         VIRTUALX_COMMAND="emake" virtualmake "$@"
>  }
>
> @@ -201,6 +220,9 @@ Xemake() {
>  Xeconf() {
>         debug-print-function ${FUNCNAME} "$@"
>
> +       [[ ${EAPI} == [2345] ]] \
> +               || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
> +
>         VIRTUALX_COMMAND="econf" virtualmake "$@"
>  }
>
> --
> 2.6.3
>
>


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

* Re: [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-28 15:28   ` Davide Pesavento
@ 2015-11-28 15:50     ` Justin Lecher (jlec)
  2015-11-30 17:40       ` Davide Pesavento
  0 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher (jlec) @ 2015-11-28 15:50 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 28/11/15 16:28, Davide Pesavento wrote:
>> else -               nonfatal ${VIRTUALX_COMMAND} "$@" +
>> nonfatal "$@"
> 
> Please take the opportunity to clean this up, possibly only in
> EAPI=6 if you don't want to risk breaking existing ebuilds. See bug
> 517976 for details.
> 
>> retval=$?

The return value is recorded and gets evaluated correctly.

src_test() {
	virtx false
}

results in

 * Scanning for an open DISPLAY to start Xvfb ...
debug: virtx: XDISPLAY=1
debug: virtx: /usr/bin/Xvfb :1 -screen 0 1280x1024x24
 * Starting Xvfb on $DISPLAY=1 ...
debug: virtx: emake "false"
 * ERROR: app-misc/dummy-1::dummy failed (test phase):
 *   virtx: the emake failed.
 *
 * Call stack:
 *     ebuild.sh, line  133:  Called src_test
 *   environment, line 2072:  Called virtx 'false'
 *   environment, line 2700:  Called die
 * The specific snippet of code:
 *       [[ ${retval} -ne 0 ]] && die "${FUNCNAME}: the
${VIRTUALX_COMMAND} failed.";
 *

Am I missing something?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0

iQJ8BAEBCgBmBQJWWc1jXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0QUU0N0I4NzFERUI0MTJFN0EyODE0NUFF
OTQwMkE3OUIwMzUyOUEyAAoJEOlAKnmwNSmiWGcQAK6VSEgzlaUaJ+AEC/I+M+Rz
uHOmaEE005MsTpUf8GoRY35fnMNkICES9QLZjaSjliBJ6H/WdGDGcqm7rg5yx0j5
v12vv3LMrFX2D/+2SkTurMlGj0gOz+F27ted/p9tmJJLf0KcbusPiJvmjybNjNH+
5ksLdZEdnAj1p9qmXfoJ8IlKHO82GUn2cNS9O0XFW9WhSzmOaE+WOp2hQtX0HzUE
Y6vcVjl5ZD+RDvc2+7oFptOQxGyEZdP43JikAEsfISHnjA4AtYHMLjIHvItaVdoD
8qbG5WAwp0fg1BwqNM6G9neAbknKeGIBLXNBx1QxVj3toz3j3QR88RB1nyovGNp2
7LZjEWYW9/jLpXVTLTg+vwsM6IgvehFdErlXEcWR/q/Gk5Q7C86o3oN4RPaQ93HV
ElxL24u/j1CW1mFzXTgKbM4rxlD8G/aROxiKAh5+66ywSrW1SRhpHSYJxriioco3
iwUyZmBtfCB40+DAHl3cX+yxQ/pKMiR7oN67fsx3F8LEalorcONq5w2e1d0bVbgs
EqdlUqxZKyI6fUK67+rI6Nd2ZBduUpm9mTvJHovPMQ3gK2hyRiE6FkhLf53aMR4S
9cmq1Bmqqw3KGTlIu45gKP6NxUr/+n1dg2LYpZF72eKKhPkNOO68YogKS073VEWc
DJGgOFCpJQIV+BLid0VF
=Nh/f
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 14:08     ` Justin Lecher (jlec)
@ 2015-11-28 15:57       ` Michał Górny
  2015-11-28 15:59         ` Justin Lecher (jlec)
  0 siblings, 1 reply; 39+ messages in thread
From: Michał Górny @ 2015-11-28 15:57 UTC (permalink / raw
  To: gentoo-dev, Justin Lecher (jlec)



Dnia 28 listopada 2015 15:08:52 CET, "Justin Lecher (jlec)" <jlec@gentoo.org> napisał(a):
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA512
>
>On 28/11/15 15:03, Michał Górny wrote:
>> 
>> 
>> Dnia 28 listopada 2015 14:24:17 CET, Justin Lecher
>> <jlec@gentoo.org> napisał(a):
>>> Signed-off-by: Justin Lecher <jlec@gentoo.org> --- 
>>> eclass/virtualx.eclass | 4 ++++ 1 file changed, 4 insertions(+)
>>> 
>>> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass 
>>> index a7f17ec..615ff0e 100644 --- a/eclass/virtualx.eclass +++
>>> b/eclass/virtualx.eclass @@ -59,6 +59,7 @@ case
>>> ${VIRTUALX_REQUIRED} in RDEPEND="" ;; optional|tests) +		[[
>>> ${EAPI} == [2345] ]] || die 'Values "optional" and "tests" are 
>>> unsupported for VIRTUALX_REQUIRED'
>> 
>> You can now make eutils conditional to EAPI.
>
>So your idea is only import eutils for EAPIs where I will need eqawarn
>from an eclass? As we have no ETA for that to change, I don't see a
>good reason to fix that inherit right now.

No, only import it for EAPIs in which you actually use it. EAPI 6 will die instead, unless you missed some more qa warnings.

>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG/MacGPG2 v2.0
>
>iQJ8BAEBCgBmBQJWWbV0XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
>ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0QUU0N0I4NzFERUI0MTJFN0EyODE0NUFF
>OTQwMkE3OUIwMzUyOUEyAAoJEOlAKnmwNSmiyCoP/3KdY8bSc6sw89Rs2xxl1wOo
>iZX3dFjq8ya8xd2AU4uMoFyJY/SitAl+/dtcmRGloirZ7o/Y7YT2/Z6s1G+GCqOe
>fXfivtGTGcGivI7F2Rs4ls8xtS3d4TWUKDR5R70kF8MMSNd+fxTtscqBUSQw8sJb
>g1nzUeNFgylUraGsCUGXTrXoPzaFRQYNCipufI4JuvL90Agr8PC6v4TsgKew9WO+
>MM/R4YnpFxubF2zw4m5qbIdbn28FVGg0mbuDc/QFLFhNApevMJacQG783k1f1TDJ
>99Gj+pPj2TgfyVVnhJYvE7s05v8vmrecX//TOvvdKYXEjoB0IR/pyAtr3rOWF+M5
>VjFWL3rfeZbKOEeQ52fRfzidOxR/thBZp/flZoJKLZmJ7baBewkpVGt+4d1KwZCM
>/KRm/1snnZY5GnspH/zxa/MI+azNWkjKKS7PW2zbNwBWQ56aiAcA4vBkBfEBfqoR
>NbRFyrBm7eEEjIwRHYj5SJuTMd236gnuXEQWeAU5o8HNnh2qiVHjdHnaF4ld/QIo
>0n7DYDeJqBeF8D274Ubd4KrQMH9LE2WbKZgNfBxpJdqPRBP6FJhvAtTQW1iqXNpt
>O4Lp9FO2jiP54Q6GWYmE8s1R2D1dXbTL10PmhGOec4tRWcrMAo5nlIwriezhHnKL
>NAEsc1lyU5vHp9OGwcjX
>=yI1e
>-----END PGP SIGNATURE-----

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


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

* Re: [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 15:57       ` Michał Górny
@ 2015-11-28 15:59         ` Justin Lecher (jlec)
  0 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher (jlec) @ 2015-11-28 15:59 UTC (permalink / raw
  To: Michał Górny, gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 28/11/15 16:57, Michał Górny wrote:
> 
> 
> Dnia 28 listopada 2015 15:08:52 CET, "Justin Lecher (jlec)"
> <jlec@gentoo.org> napisał(a): On 28/11/15 15:03, Michał Górny
> wrote:
>>>> 
>>>> 
>>>> Dnia 28 listopada 2015 14:24:17 CET, Justin Lecher 
>>>> <jlec@gentoo.org> napisał(a):
>>>>> Signed-off-by: Justin Lecher <jlec@gentoo.org> --- 
>>>>> eclass/virtualx.eclass | 4 ++++ 1 file changed, 4
>>>>> insertions(+)
>>>>> 
>>>>> diff --git a/eclass/virtualx.eclass
>>>>> b/eclass/virtualx.eclass index a7f17ec..615ff0e 100644 ---
>>>>> a/eclass/virtualx.eclass +++ b/eclass/virtualx.eclass @@
>>>>> -59,6 +59,7 @@ case ${VIRTUALX_REQUIRED} in RDEPEND="" ;;
>>>>> optional|tests) +		[[ ${EAPI} == [2345] ]] || die 'Values
>>>>> "optional" and "tests" are unsupported for
>>>>> VIRTUALX_REQUIRED'
>>>> 
>>>> You can now make eutils conditional to EAPI.
> 
> So your idea is only import eutils for EAPIs where I will need
> eqawarn
>>> from an eclass? As we have no ETA for that to change, I don't
>>> see a
> good reason to fix that inherit right now.
> 
>> No, only import it for EAPIs in which you actually use it. EAPI 6
>> will die instead, unless you missed some more qa warnings.

Good catch. Thanks

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0

iQJ8BAEBCgBmBQJWWc9dXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0QUU0N0I4NzFERUI0MTJFN0EyODE0NUFF
OTQwMkE3OUIwMzUyOUEyAAoJEOlAKnmwNSmi2k4P/ip/shOkEwCXPZlPFeY4qiP1
F8fsBAri7M3xlki9DjAp+LoVFVAxVTvoYn8HFWp84gCOjTHSoLbiVpRiX+jKdbUl
dcoSrbGtaaKNT038kLrsRsZQTEzARJR3pw2MZdBb4my38c71Vei8uWwZv1CXM1Pi
uch5bGjzAbDHHbBa07vkgxNpm03D1fe9d2K8kdxbsFXfTRs25fODP+6R7fzifarc
zCYH2Ritif7FXwLwEc1nwveEVt3TnQyxEdPcN5yHYFpQ6GVRQsfJJDk/QauHh9x+
kUnmLwhrzc8AhLltboo1lZgXH7/8W1OaXbHPYtAuk3zEETuKBBzNFp8nlDvFLtfp
1h9sH9VZCddYy2ckA2BCIRosXyAznzgGS1ub0BQsHyjH+ji++pn4ju4LoJLT7i0v
fE07E59ipgA0yq0DbPLp5n/6yhnADj0/C9GaT9FVN+YJYceMejyU3v+Ofn7KRD7n
3p8fU4EUFfU0XqufhwTdKuXpcwg2VJm1eSt5DLs4JpA2yNlpgyZev3n+mo1jFrIM
RMK9xlcWbsz4oiRUS+uFCVJ4pK6Xa8lqk3BhvbPTCh1tapWivQ00O9iNyj8Wfoeo
jV4KQi8ai+1juT+vYvDU3yr831uux4I70D+qfMci+/pQnzHl8AIRicSygUTCD9sl
S1MUVE31Ydqg70FjlDAB
=NqmF
-----END PGP SIGNATURE-----


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

* [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs
  2015-11-28 14:02 ` [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Michał Górny
@ 2015-11-28 16:20   ` Justin Lecher
  2015-11-28 16:20     ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
                       ` (6 more replies)
  0 siblings, 7 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 5d27ed9..3d0c6c8 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -9,6 +9,17 @@
 # Original author: Martin Schlemmer <azarah@gentoo.org>
 # @BLURB: This eclass can be used for packages that needs a working X environment to build.
 
+case "${EAPI:-0}" in
+	0|1)
+		die "virtualx.eclass: EAPI ${EAPI} is too old."
+		;;
+	2|3|4|5)
+		;;
+	*)
+		die "EAPI ${EAPI} is not supported yet."
+		;;
+esac
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -35,7 +46,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
 # (within virtualmake function).
 : ${VIRTUALX_COMMAND:="emake"}
 
-has "${EAPI:-0}" 0 1 && die "virtualx eclass require EAPI=2 or newer."
 
 case ${VIRTUALX_REQUIRED} in
 	manual)
-- 
2.6.3



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

* [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
@ 2015-11-28 16:20     ` Justin Lecher
  2015-11-28 16:20     ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
                       ` (5 subsequent siblings)
  6 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 3d0c6c8..517bdac 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -20,6 +20,8 @@ case "${EAPI:-0}" in
 		;;
 esac
 
+if [[ ! ${_VIRTUAL_X} ]]; then
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -195,3 +197,6 @@ Xeconf() {
 
 	VIRTUALX_COMMAND="econf" virtualmake "$@"
 }
+
+_VIRTUAL_X=1
+fi
-- 
2.6.3



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

* [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..."
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
  2015-11-28 16:20     ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
@ 2015-11-28 16:20     ` Justin Lecher
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
                       ` (4 subsequent siblings)
  6 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 517bdac..230897b 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -22,6 +22,8 @@ esac
 
 if [[ ! ${_VIRTUAL_X} ]]; then
 
+[[ ${EAPI} == [2345] ]] && inherit eutils
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -58,15 +60,15 @@ case ${VIRTUALX_REQUIRED} in
 		;;
 	optional|tests)
 		# deprecated section YAY.
-		ewarn "QA: VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
-		ewarn "QA: You can drop the variable definition completely from ebuild,"
-		ewarn "QA: because it is default behaviour."
+		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
+		eqawarn "You can drop the variable definition completely from ebuild,"
+		eqawarn "because it is default behaviour."
 
 		if [[ -n ${VIRTUALX_USE} ]]; then
 			# so they like to specify the useflag
-			ewarn "QA: VIRTUALX_USE variable is deprecated."
-			ewarn "QA: Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
-			ewarn "QA: to achieve the same behaviour."
+			eqawarn "VIRTUALX_USE variable is deprecated."
+			eqawarn "Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
+			eqawarn "to achieve the same behaviour."
 		fi
 
 		[[ -z ${VIRTUALX_USE} ]] && VIRTUALX_USE="test"
@@ -97,9 +99,9 @@ virtualmake() {
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
-		ewarn "QA: ebuild is exporting \$maketype=${maketype}"
-		ewarn "QA: Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
-		ewarn "QA: Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
+		eqawarn "ebuild is exporting \$maketype=${maketype}"
+		eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
+		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
 		VIRTUALX_COMMAND=${maketype}
 	fi
 
@@ -175,8 +177,8 @@ virtualmake() {
 Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	ewarn "QA: you should not execute make directly"
-	ewarn "QA: rather execute Xemake -j1 if you have issues with parallel make"
+	eqawarn "you should not execute make directly"
+	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
 }
 
-- 
2.6.3



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

* [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
  2015-11-28 16:20     ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
  2015-11-28 16:20     ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
@ 2015-11-28 16:21     ` Justin Lecher
  2015-11-29  9:57       ` Michał Górny
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Whitespace cleanup Justin Lecher
                       ` (3 subsequent siblings)
  6 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 230897b..a5e5457 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -59,6 +59,8 @@ case ${VIRTUALX_REQUIRED} in
 		RDEPEND=""
 		;;
 	optional|tests)
+		[[ ${EAPI} == [2345] ]] \
+			|| die 'Values "optional" and "tests" are unsupported for VIRTUALX_REQUIRED'
 		# deprecated section YAY.
 		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
 		eqawarn "You can drop the variable definition completely from ebuild,"
@@ -177,6 +179,9 @@ virtualmake() {
 Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
+
 	eqawarn "you should not execute make directly"
 	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
-- 
2.6.3



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

* [gentoo-dev] [PATCH 5/8] virtualx.eclass: Whitespace cleanup
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
                       ` (2 preceding siblings ...)
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
@ 2015-11-28 16:21     ` Justin Lecher
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Add missing die Justin Lecher
                       ` (2 subsequent siblings)
  6 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 1 -
 1 file changed, 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index a5e5457..1f90147 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -50,7 +50,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
 # (within virtualmake function).
 : ${VIRTUALX_COMMAND:="emake"}
 
-
 case ${VIRTUALX_REQUIRED} in
 	manual)
 		;;
-- 
2.6.3



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

* [gentoo-dev] [PATCH 6/8] virtualx.eclass: Add missing die
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
                       ` (3 preceding siblings ...)
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Whitespace cleanup Justin Lecher
@ 2015-11-28 16:21     ` Justin Lecher
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6 Justin Lecher
  6 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 1f90147..d10dbb2 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -94,9 +94,10 @@ virtualmake() {
 	local i=0
 	local retval=0
 	local OLD_SANDBOX_ON="${SANDBOX_ON}"
-	local XVFB=$(type -p Xvfb)
-	local XHOST=$(type -p xhost)
+	local XVFB XHOST XDISPLAY
 	local xvfbargs="-screen 0 1280x1024x24"
+	XVFB=$(type -p Xvfb) || die
+	XHOST=$(type -p xhost) || die
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
-- 
2.6.3



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

* [gentoo-dev] [PATCH 7/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
                       ` (4 preceding siblings ...)
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Add missing die Justin Lecher
@ 2015-11-28 16:21     ` Justin Lecher
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6 Justin Lecher
  6 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

The new API runs all specified arguments to virtx() inside an XFVB,
instead of defining VIRTUALX_COMMAND and running that in virtualmake.

Xemake and Xeconf should be replaced by "virtx emake" and "virtx econf".

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 56 +++++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 46 insertions(+), 10 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index d10dbb2..b124034 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -91,22 +91,52 @@ esac
 virtualmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	local i=0
-	local retval=0
-	local OLD_SANDBOX_ON="${SANDBOX_ON}"
-	local XVFB XHOST XDISPLAY
-	local xvfbargs="-screen 0 1280x1024x24"
-	XVFB=$(type -p Xvfb) || die
-	XHOST=$(type -p xhost) || die
+	[[ ${EAPI} == [2345] ]] || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
+		[[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5"
 		eqawarn "ebuild is exporting \$maketype=${maketype}"
 		eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
 		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
 		VIRTUALX_COMMAND=${maketype}
 	fi
 
+	virtx "${VIRTUALX_COMMAND}" "${@}"
+}
+
+
+# @FUNCTION: virtx
+# @USAGE: <command> [command arguments]
+# @DESCRIPTION:
+# Start new Xvfb session and run commands in it.
+#
+# Example:
+#
+# @CODE
+# src_test() {
+# 	virtx default
+# }
+# @CODE
+#
+# @CODE
+# python_test() {
+# 	virtx py.test --verbose
+# }
+# @CODE
+virtx() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	[[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument"
+
+	local i=0
+	local retval=0
+	local OLD_SANDBOX_ON="${SANDBOX_ON}"
+	local XVFB XHOST XDISPLAY
+	local xvfbargs="-screen 0 1280x1024x24"
+	XVFB=$(type -p Xvfb) || die
+	XHOST=$(type -p xhost) || die
+
 	debug-print "${FUNCNAME}: running Xvfb hack"
 	export XAUTHORITY=
 	# The following is derived from Mandrake's hack to allow
@@ -156,10 +186,10 @@ virtualmake() {
 	# to kill Xvfb
 	debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\""
 	if has "${EAPI}" 2 3; then
-		${VIRTUALX_COMMAND} "$@"
+		"$@"
 		retval=$?
 	else
-		nonfatal ${VIRTUALX_COMMAND} "$@"
+		nonfatal "$@"
 		retval=$?
 	fi
 
@@ -180,7 +210,7 @@ Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	[[ ${EAPI} == [2345] ]] \
-		|| die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
 
 	eqawarn "you should not execute make directly"
 	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
@@ -193,6 +223,9 @@ Xmake() {
 Xemake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
+
 	VIRTUALX_COMMAND="emake" virtualmake "$@"
 }
 
@@ -202,6 +235,9 @@ Xemake() {
 Xeconf() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
+
 	VIRTUALX_COMMAND="econf" virtualmake "$@"
 }
 
-- 
2.6.3



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

* [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6
  2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
                       ` (5 preceding siblings ...)
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
@ 2015-11-28 16:21     ` Justin Lecher
  6 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-28 16:21 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index b124034..95f4ed0 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -13,7 +13,7 @@ case "${EAPI:-0}" in
 	0|1)
 		die "virtualx.eclass: EAPI ${EAPI} is too old."
 		;;
-	2|3|4|5)
+	2|3|4|5|6)
 		;;
 	*)
 		die "EAPI ${EAPI} is not supported yet."
-- 
2.6.3



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

* Re: [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-28 16:21     ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
@ 2015-11-29  9:57       ` Michał Górny
  2015-11-29 12:02         ` Justin Lecher (jlec)
  0 siblings, 1 reply; 39+ messages in thread
From: Michał Górny @ 2015-11-29  9:57 UTC (permalink / raw
  To: Justin Lecher; +Cc: gentoo-dev

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

On Sat, 28 Nov 2015 17:21:00 +0100
Justin Lecher <jlec@gentoo.org> wrote:

> Signed-off-by: Justin Lecher <jlec@gentoo.org>
> ---
>  eclass/virtualx.eclass | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
> index 230897b..a5e5457 100644
> --- a/eclass/virtualx.eclass
> +++ b/eclass/virtualx.eclass
> @@ -59,6 +59,8 @@ case ${VIRTUALX_REQUIRED} in
>  		RDEPEND=""
>  		;;
>  	optional|tests)
> +		[[ ${EAPI} == [2345] ]] \
> +			|| die 'Values "optional" and "tests" are unsupported for VIRTUALX_REQUIRED'

You don't mention EAPI here, which can get confusing.

>  		# deprecated section YAY.
>  		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
>  		eqawarn "You can drop the variable definition completely from ebuild,"
> @@ -177,6 +179,9 @@ virtualmake() {
>  Xmake() {
>  	debug-print-function ${FUNCNAME} "$@"
>  
> +	[[ ${EAPI} == [2345] ]] \
> +		|| die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead"
> +
>  	eqawarn "you should not execute make directly"
>  	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
>  	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"

Still, if you introduced virtx earlier, you wouldn't have to change
this die message later on ;-).

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

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

* Re: [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-29  9:57       ` Michał Górny
@ 2015-11-29 12:02         ` Justin Lecher (jlec)
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
  0 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher (jlec) @ 2015-11-29 12:02 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 29/11/15 10:57, Michał Górny wrote:
> On Sat, 28 Nov 2015 17:21:00 +0100 Justin Lecher <jlec@gentoo.org>
> wrote:
> 
>> Signed-off-by: Justin Lecher <jlec@gentoo.org> --- 
>> eclass/virtualx.eclass | 5 +++++ 1 file changed, 5 insertions(+)
>> 
>> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass 
>> index 230897b..a5e5457 100644 --- a/eclass/virtualx.eclass +++
>> b/eclass/virtualx.eclass @@ -59,6 +59,8 @@ case
>> ${VIRTUALX_REQUIRED} in RDEPEND="" ;; optional|tests) +		[[
>> ${EAPI} == [2345] ]] \ +			|| die 'Values "optional" and "tests"
>> are unsupported for VIRTUALX_REQUIRED'
> 
> You don't mention EAPI here, which can get confusing.

Valid point.

> 
>> # deprecated section YAY. eqawarn "VIRTUALX_REQUIRED=optional and
>> VIRTUALX_REQUIRED=tests are deprecated." eqawarn "You can drop
>> the variable definition completely from ebuild," @@ -177,6 +179,9
>> @@ virtualmake() { Xmake() { debug-print-function ${FUNCNAME}
>> "$@"
>> 
>> +	[[ ${EAPI} == [2345] ]] \ +		|| die "${FUNCNAME} is removed in
>> EAPI > 5; use Xemake -j1 instead" + eqawarn "you should not
>> execute make directly" eqawarn "rather execute Xemake -j1 if you
>> have issues with parallel make" VIRTUALX_COMMAND="emake -j1"
>> virtualmake "$@"
> 
> Still, if you introduced virtx earlier, you wouldn't have to
> change this die message later on ;-).
> 

Principally you are right, but resorting the patches generates lots of
merge conflicts. But let me practice my git skills

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0

iQJ8BAEBCgBmBQJWWulWXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0QUU0N0I4NzFERUI0MTJFN0EyODE0NUFF
OTQwMkE3OUIwMzUyOUEyAAoJEOlAKnmwNSmiDUwP/09Q4xMEfaPeAlBIrv120PDc
uqkJeBGHuKDtR6gmgydg+5bVdj6UwElZUsOaNMuBMkCAcrnHfP2WQ/lJafooK4K+
baiVqyFXTKemR8ob2hNLLD5lrvWijvjzc9TAutpfVvJm/NnGNRF2BpmnNKMtVWBO
0RP1pl+Wfjbzzb52KT96GUeeJqunY0EReuoZ2U9pG1HAnVbOGNacxkeSeJA+pfQ4
FQPqhnDAOQMS0p/uXro8h8TeDRIF2wwcRvmCOePKjRF/Ut6sw1/Pogj6iuTxTyaz
m16ebTJmJ1GKc5mk6Fy4yDp6OR8tdgVwYsq+tjq9fMARqDOA/eJRS0I6/uIgaj0h
0dHzBYXxtTBixseVvPXAHY80RWSf5nseTceYVPSuHp+PRAhkrVneWsWfnBelqyzS
Xj+jAPxDRU4gPat3SFt1fRER6A9Ij5VzRTHEEca/kjFvzwxmRs+MxDd7AN8IJK/v
IhfDCgWf6kth0iCKHUkPZgd/ZOoHOUW4rMsGylObWQpCKz9Uzlo/T44Mj5Lr38nK
Ydr1AND394O+74EOSGl2IcQiEFUQcrRIkUyOHIqBex/GAaL1wbyfcQ2u7mtNmddm
Jc5jIM/FzmcDAnZgkxii69fjGb46HsPBUtriAmPydh7mN/ahHy0sPbQqxT3ANYxU
QTYUPft2ma0fmb9TJjO4
=ZaQj
-----END PGP SIGNATURE-----


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

* [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3
  2015-11-29 12:02         ` Justin Lecher (jlec)
@ 2015-11-29 12:24           ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
                               ` (7 more replies)
  0 siblings, 8 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

So next try. patches slightly resorted, die message wording adopted.

Justin Lecher (8):
  virtualx.eclass: Use case/esac to handle supported EAPIs
  virtualx.eclass: Only source eclass once
  virtualx.eclass: Use eqawarn instead of ewarn "QA:..."
  virtualx.eclass: Whitespace cleanup
  virtualx.eclass: Add missing die
  virtualx.eclass: Simplify API into single virtx()
  virtualx.eclass: Ban deprecated functionality in EAPI > 5
  virtualx.eclass: Support EAPI=6

 eclass/virtualx.eclass | 103 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 81 insertions(+), 22 deletions(-)

-- 
2.6.3



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

* [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
                               ` (6 subsequent siblings)
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 5d27ed9..e9ff3af 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -9,6 +9,17 @@
 # Original author: Martin Schlemmer <azarah@gentoo.org>
 # @BLURB: This eclass can be used for packages that needs a working X environment to build.
 
+case "${EAPI:-0}" in
+	0|1)
+		die "virtualx.eclass: EAPI ${EAPI} is too old."
+		;;
+	2|3|4|5)
+		;;
+	*)
+		die "virtualx.eclass: EAPI ${EAPI} is not supported yet."
+		;;
+esac
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -35,7 +46,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
 # (within virtualmake function).
 : ${VIRTUALX_COMMAND:="emake"}
 
-has "${EAPI:-0}" 0 1 && die "virtualx eclass require EAPI=2 or newer."
 
 case ${VIRTUALX_REQUIRED} in
 	manual)
-- 
2.6.3



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

* [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
                               ` (5 subsequent siblings)
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index e9ff3af..8d66da0 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -9,6 +9,8 @@
 # Original author: Martin Schlemmer <azarah@gentoo.org>
 # @BLURB: This eclass can be used for packages that needs a working X environment to build.
 
+if [[ ! ${_VIRTUAL_X} ]]; then
+
 case "${EAPI:-0}" in
 	0|1)
 		die "virtualx.eclass: EAPI ${EAPI} is too old."
@@ -195,3 +197,6 @@ Xeconf() {
 
 	VIRTUALX_COMMAND="econf" virtualmake "$@"
 }
+
+_VIRTUAL_X=1
+fi
-- 
2.6.3



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

* [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..."
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Whitespace cleanup Justin Lecher
                               ` (4 subsequent siblings)
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 8d66da0..c2bef68 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -22,6 +22,8 @@ case "${EAPI:-0}" in
 		;;
 esac
 
+inherit eutils
+
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
 # Variable specifying the dependency on xorg-server and xhost.
@@ -58,15 +60,15 @@ case ${VIRTUALX_REQUIRED} in
 		;;
 	optional|tests)
 		# deprecated section YAY.
-		ewarn "QA: VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
-		ewarn "QA: You can drop the variable definition completely from ebuild,"
-		ewarn "QA: because it is default behaviour."
+		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
+		eqawarn "You can drop the variable definition completely from ebuild,"
+		eqawarn "because it is default behaviour."
 
 		if [[ -n ${VIRTUALX_USE} ]]; then
 			# so they like to specify the useflag
-			ewarn "QA: VIRTUALX_USE variable is deprecated."
-			ewarn "QA: Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
-			ewarn "QA: to achieve the same behaviour."
+			eqawarn "VIRTUALX_USE variable is deprecated."
+			eqawarn "Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
+			eqawarn "to achieve the same behaviour."
 		fi
 
 		[[ -z ${VIRTUALX_USE} ]] && VIRTUALX_USE="test"
@@ -97,9 +99,9 @@ virtualmake() {
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
-		ewarn "QA: ebuild is exporting \$maketype=${maketype}"
-		ewarn "QA: Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
-		ewarn "QA: Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
+		eqawarn "ebuild is exporting \$maketype=${maketype}"
+		eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
+		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
 		VIRTUALX_COMMAND=${maketype}
 	fi
 
@@ -175,8 +177,8 @@ virtualmake() {
 Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	ewarn "QA: you should not execute make directly"
-	ewarn "QA: rather execute Xemake -j1 if you have issues with parallel make"
+	eqawarn "you should not execute make directly"
+	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
 }
 
-- 
2.6.3



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

* [gentoo-dev] [PATCH 4/8] virtualx.eclass: Whitespace cleanup
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
                               ` (2 preceding siblings ...)
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Add missing die Justin Lecher
                               ` (3 subsequent siblings)
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 1 -
 1 file changed, 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index c2bef68..78f5429 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -50,7 +50,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND}
 # (within virtualmake function).
 : ${VIRTUALX_COMMAND:="emake"}
 
-
 case ${VIRTUALX_REQUIRED} in
 	manual)
 		;;
-- 
2.6.3



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

* [gentoo-dev] [PATCH 5/8] virtualx.eclass: Add missing die
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
                               ` (3 preceding siblings ...)
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Whitespace cleanup Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
                               ` (2 subsequent siblings)
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 78f5429..3df3fe1 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -92,9 +92,10 @@ virtualmake() {
 	local i=0
 	local retval=0
 	local OLD_SANDBOX_ON="${SANDBOX_ON}"
-	local XVFB=$(type -p Xvfb)
-	local XHOST=$(type -p xhost)
+	local XVFB XHOST XDISPLAY
 	local xvfbargs="-screen 0 1280x1024x24"
+	XVFB=$(type -p Xvfb) || die
+	XHOST=$(type -p xhost) || die
 
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
-- 
2.6.3



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

* [gentoo-dev] [PATCH 6/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
                               ` (4 preceding siblings ...)
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Add missing die Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6 Justin Lecher
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

The new API runs all specified arguments to virtx() inside an XFVB,
instead of defining VIRTUALX_COMMAND and running that in virtualmake.

Xemake and Xeconf should be replaced by "virtx emake" and "virtx econf".

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 47 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 37 insertions(+), 10 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 3df3fe1..bdecda6 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -89,14 +89,6 @@ esac
 virtualmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	local i=0
-	local retval=0
-	local OLD_SANDBOX_ON="${SANDBOX_ON}"
-	local XVFB XHOST XDISPLAY
-	local xvfbargs="-screen 0 1280x1024x24"
-	XVFB=$(type -p Xvfb) || die
-	XHOST=$(type -p xhost) || die
-
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
 		eqawarn "ebuild is exporting \$maketype=${maketype}"
@@ -105,6 +97,41 @@ virtualmake() {
 		VIRTUALX_COMMAND=${maketype}
 	fi
 
+	virtx "${VIRTUALX_COMMAND}" "${@}"
+}
+
+
+# @FUNCTION: virtx
+# @USAGE: <command> [command arguments]
+# @DESCRIPTION:
+# Start new Xvfb session and run commands in it.
+#
+# Example:
+#
+# @CODE
+# src_test() {
+# 	virtx default
+# }
+# @CODE
+#
+# @CODE
+# python_test() {
+# 	virtx py.test --verbose
+# }
+# @CODE
+virtx() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	[[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument"
+
+	local i=0
+	local retval=0
+	local OLD_SANDBOX_ON="${SANDBOX_ON}"
+	local XVFB XHOST XDISPLAY
+	local xvfbargs="-screen 0 1280x1024x24"
+	XVFB=$(type -p Xvfb) || die
+	XHOST=$(type -p xhost) || die
+
 	debug-print "${FUNCNAME}: running Xvfb hack"
 	export XAUTHORITY=
 	# The following is derived from Mandrake's hack to allow
@@ -154,10 +181,10 @@ virtualmake() {
 	# to kill Xvfb
 	debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\""
 	if has "${EAPI}" 2 3; then
-		${VIRTUALX_COMMAND} "$@"
+		"$@"
 		retval=$?
 	else
-		nonfatal ${VIRTUALX_COMMAND} "$@"
+		nonfatal "$@"
 		retval=$?
 	fi
 
-- 
2.6.3



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

* [gentoo-dev] [PATCH 7/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
                               ` (5 preceding siblings ...)
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  2015-11-29 13:21               ` Michał Górny
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6 Justin Lecher
  7 siblings, 1 reply; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index bdecda6..344cd63 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -22,7 +22,7 @@ case "${EAPI:-0}" in
 		;;
 esac
 
-inherit eutils
+[[ ${EAPI} == [2345] ]] && inherit eutils
 
 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
 # @DESCRIPTION:
@@ -58,6 +58,8 @@ case ${VIRTUALX_REQUIRED} in
 		RDEPEND=""
 		;;
 	optional|tests)
+		[[ ${EAPI} == [2345] ]] \
+			|| die 'Values "optional" and "tests" for VIRTUALX_REQUIRED are banned in EAPI > 5'
 		# deprecated section YAY.
 		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
 		eqawarn "You can drop the variable definition completely from ebuild,"
@@ -89,8 +91,12 @@ esac
 virtualmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
+
 	# backcompat for maketype
 	if [[ -n ${maketype} ]]; then
+		[[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5"
 		eqawarn "ebuild is exporting \$maketype=${maketype}"
 		eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead."
 		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now."
@@ -204,6 +210,9 @@ virtx() {
 Xmake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
+
 	eqawarn "you should not execute make directly"
 	eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
@@ -215,6 +224,9 @@ Xmake() {
 Xemake() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
+
 	VIRTUALX_COMMAND="emake" virtualmake "$@"
 }
 
@@ -224,6 +236,9 @@ Xemake() {
 Xeconf() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	[[ ${EAPI} == [2345] ]] \
+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
+
 	VIRTUALX_COMMAND="econf" virtualmake "$@"
 }
 
-- 
2.6.3



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

* [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6
  2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
                               ` (6 preceding siblings ...)
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
@ 2015-11-29 12:24             ` Justin Lecher
  7 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher @ 2015-11-29 12:24 UTC (permalink / raw
  To: gentoo-dev; +Cc: Justin Lecher

Signed-off-by: Justin Lecher <jlec@gentoo.org>
---
 eclass/virtualx.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index 344cd63..de1582c 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -15,7 +15,7 @@ case "${EAPI:-0}" in
 	0|1)
 		die "virtualx.eclass: EAPI ${EAPI} is too old."
 		;;
-	2|3|4|5)
+	2|3|4|5|6)
 		;;
 	*)
 		die "virtualx.eclass: EAPI ${EAPI} is not supported yet."
-- 
2.6.3



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

* Re: [gentoo-dev] [PATCH 7/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5
  2015-11-29 12:24             ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
@ 2015-11-29 13:21               ` Michał Górny
  0 siblings, 0 replies; 39+ messages in thread
From: Michał Górny @ 2015-11-29 13:21 UTC (permalink / raw
  To: gentoo-dev, Justin Lecher; +Cc: Justin Lecher



Dnia 29 listopada 2015 13:24:43 CET, Justin Lecher <jlec@gentoo.org> napisał(a):
>Signed-off-by: Justin Lecher <jlec@gentoo.org>
>---
> eclass/virtualx.eclass | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
>diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
>index bdecda6..344cd63 100644
>--- a/eclass/virtualx.eclass
>+++ b/eclass/virtualx.eclass
>@@ -22,7 +22,7 @@ case "${EAPI:-0}" in
> 		;;
> esac
> 
>-inherit eutils
>+[[ ${EAPI} == [2345] ]] && inherit eutils
> 
> # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
> # @DESCRIPTION:
>@@ -58,6 +58,8 @@ case ${VIRTUALX_REQUIRED} in
> 		RDEPEND=""
> 		;;
> 	optional|tests)
>+		[[ ${EAPI} == [2345] ]] \
>+			|| die 'Values "optional" and "tests" for VIRTUALX_REQUIRED are
>banned in EAPI > 5'
> 		# deprecated section YAY.
>		eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are
>deprecated."
>		eqawarn "You can drop the variable definition completely from
>ebuild,"
>@@ -89,8 +91,12 @@ esac
> virtualmake() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	[[ ${EAPI} == [2345] ]] \
>+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
>+
> 	# backcompat for maketype
> 	if [[ -n ${maketype} ]]; then
>+		[[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5"
> 		eqawarn "ebuild is exporting \$maketype=${maketype}"
>		eqawarn "Ebuild should be migrated to use
>VIRTUALX_COMMAND=${maketype} instead."

Here's one more reference to deprecated API.

>		eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for
>now."
>@@ -204,6 +210,9 @@ virtx() {
> Xmake() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	[[ ${EAPI} == [2345] ]] \
>+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx
>emake -j1 ....'"
>+
> 	eqawarn "you should not execute make directly"
>	eqawarn "rather execute Xemake -j1 if you have issues with parallel
>make"
> 	VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
>@@ -215,6 +224,9 @@ Xmake() {
> Xemake() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	[[ ${EAPI} == [2345] ]] \
>+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx
>emake ....'"
>+
> 	VIRTUALX_COMMAND="emake" virtualmake "$@"
> }
> 
>@@ -224,6 +236,9 @@ Xemake() {
> Xeconf() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	[[ ${EAPI} == [2345] ]] \
>+		|| die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx
>econf ....'"
>+
> 	VIRTUALX_COMMAND="econf" virtualmake "$@"
> }
> 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


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

* Re: [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-28 15:50     ` Justin Lecher (jlec)
@ 2015-11-30 17:40       ` Davide Pesavento
  2015-12-01  7:25         ` Justin Lecher (jlec)
  0 siblings, 1 reply; 39+ messages in thread
From: Davide Pesavento @ 2015-11-30 17:40 UTC (permalink / raw
  To: gentoo-dev

On Sat, Nov 28, 2015 at 4:50 PM, Justin Lecher (jlec) <jlec@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On 28/11/15 16:28, Davide Pesavento wrote:
>>> else -               nonfatal ${VIRTUALX_COMMAND} "$@" +
>>> nonfatal "$@"
>>
>> Please take the opportunity to clean this up, possibly only in
>> EAPI=6 if you don't want to risk breaking existing ebuilds. See bug
>> 517976 for details.
>>
>>> retval=$?
>
> The return value is recorded and gets evaluated correctly.
>
> src_test() {
>         virtx false
> }
>
[...]
>
> Am I missing something?

The scenario of bug 517976 is different. I think a minimized test case
is the following (untested):

foo() {
    die "meh"
    return 0
}

src_test() {
    virtx foo
}


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

* Re: [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx()
  2015-11-30 17:40       ` Davide Pesavento
@ 2015-12-01  7:25         ` Justin Lecher (jlec)
  0 siblings, 0 replies; 39+ messages in thread
From: Justin Lecher (jlec) @ 2015-12-01  7:25 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 30/11/15 18:40, Davide Pesavento wrote:
> 
> The scenario of bug 517976 is different. I think a minimized test
> case is the following (untested):
> 
> foo() { die "meh" return 0 }
> 
> src_test() { virtx foo }
> 

This example will still break the build, although the Xvfb session
wouldn't get killed. Let's move the discussion to the bug.

Justin

* Scanning for an open DISPLAY to start Xvfb ...
debug: virtx: XDISPLAY=0
debug: virtx: /usr/bin/Xvfb :0 -screen 0 1280x1024x24
 * Starting Xvfb on $DISPLAY=0 ...
debug: virtx: emake "foo"
 * ERROR: app-misc/dummy-1::dummy failed (test phase):
 *   meh
 *
 * Call stack:
 *               ebuild.sh, line  133:  Called src_test
 *             environment, line 2076:  Called virtx 'foo'
 *             environment, line 2699:  Called nonfatal 'foo'
 *   isolated-functions.sh, line  105:  Called foo
 *             environment, line  987:  Called die
 * The specific snippet of code:
 *       die "meh";
 *
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0

iQJ8BAEBCgBmBQJWXUt6XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ0QUU0N0I4NzFERUI0MTJFN0EyODE0NUFF
OTQwMkE3OUIwMzUyOUEyAAoJEOlAKnmwNSmiWGsQALjFU4Z+1yUOUWGyBf7n31hc
FUAq/ZnsFEd8ZPKRSyZVY+os/PjbwMCQQk0U7hUySLZ43mSfzC0aelKMAXx6BYoS
ss8jp2s5LoeIV+YdCIUiIE/y4GHvYwln61W+XrM6TslEaAMVbrKuKoa/TvzE6mrN
Et9ebl7E6LpwTMc72jdGd8KWtkLdl2Ddgt99pKcC9vA7IEZPGlci/Nz7AtHycP3m
YectPEzWVdirNlRcKCDxcCdHbYH1mKjd3kjtatb6nDXURhM4l4qL/OZEdx5mKpyp
EAu+7RzU7XOgyUMuvwWpPtmA/jaR6VSEWJY9W+EwYS3LwNRJczADfEGzE2EGCj+r
0iSOvF2b9DqgO800ENSPH7iUgvgw3pTLqMdUSHsvZg5dw1u08S1DCuB2T1/9Nfin
OUk/zsGELJQ5C0m7a1vugG1PNBmjKNlaKtW+bIDitPgL71GCeQ2QU0Oo5SKRH+bv
Qp2mguaR3nL1xm6MrnRT7bIKW92FRDT2P3eHTRylWg495/i8veaiUL/QBwnegOU5
En4kCyaBusujyT2l5DZnYb6RNOfUWlFQOquaKbK1yRtDsk7tG+HfRkSQR4s6Dlo4
sIdCrjhvgDeTy+6DwcXGWex1nG2ZUkLu36O6uIEFphTgbG3dlXYE1lvrGLwIHyZg
/5PC3gOTW6R0s/DfzDDh
=8pwz
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2015-12-01  7:26 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-28 13:24 [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Justin Lecher
2015-11-28 13:24 ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
2015-11-28 14:46   ` Davide Pesavento
2015-11-28 13:24 ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
2015-11-28 13:24 ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
2015-11-28 13:24 ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
2015-11-28 14:03   ` Michał Górny
2015-11-28 14:08     ` Justin Lecher (jlec)
2015-11-28 15:57       ` Michał Górny
2015-11-28 15:59         ` Justin Lecher (jlec)
2015-11-28 13:24 ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Support EAPI=6 Justin Lecher
2015-11-28 13:24 ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Whitespace cleanup Justin Lecher
2015-11-28 13:24 ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Add missing die Justin Lecher
2015-11-28 13:24 ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
2015-11-28 15:28   ` Davide Pesavento
2015-11-28 15:50     ` Justin Lecher (jlec)
2015-11-30 17:40       ` Davide Pesavento
2015-12-01  7:25         ` Justin Lecher (jlec)
2015-11-28 14:02 ` [gentoo-dev] [PATCH 0/8] virtualx.eclass: New API and EAPI=6 support Michał Górny
2015-11-28 16:20   ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
2015-11-28 16:20     ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
2015-11-28 16:20     ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
2015-11-28 16:21     ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
2015-11-29  9:57       ` Michał Górny
2015-11-29 12:02         ` Justin Lecher (jlec)
2015-11-29 12:24           ` [gentoo-dev] [PATCH 0/8] virtualx.eclass updates version 3 Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 1/8] virtualx.eclass: Use case/esac to handle supported EAPIs Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 2/8] virtualx.eclass: Only source eclass once Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 3/8] virtualx.eclass: Use eqawarn instead of ewarn "QA:..." Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 4/8] virtualx.eclass: Whitespace cleanup Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Add missing die Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
2015-11-29 12:24             ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Ban deprecated functionality in EAPI > 5 Justin Lecher
2015-11-29 13:21               ` Michał Górny
2015-11-29 12:24             ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6 Justin Lecher
2015-11-28 16:21     ` [gentoo-dev] [PATCH 5/8] virtualx.eclass: Whitespace cleanup Justin Lecher
2015-11-28 16:21     ` [gentoo-dev] [PATCH 6/8] virtualx.eclass: Add missing die Justin Lecher
2015-11-28 16:21     ` [gentoo-dev] [PATCH 7/8] virtualx.eclass: Simplify API into single virtx() Justin Lecher
2015-11-28 16:21     ` [gentoo-dev] [PATCH 8/8] virtualx.eclass: Support EAPI=6 Justin Lecher

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