1 |
On Sat, Nov 28, 2015 at 2:24 PM, Justin Lecher <jlec@g.o> wrote: |
2 |
> The new API runs all specified arguments to virtx() inside an XFVB, |
3 |
> instead of defining VIRTUALX_COMMAND and running that in virtualmake. |
4 |
> |
5 |
> Xemake and Xeconf should be replaced by "virtx emake" and "virtx econf". |
6 |
> |
7 |
> Signed-off-by: Justin Lecher <jlec@g.o> |
8 |
> --- |
9 |
> eclass/virtualx.eclass | 42 ++++++++++++++++++++++++++++++++---------- |
10 |
> 1 file changed, 32 insertions(+), 10 deletions(-) |
11 |
> |
12 |
> diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass |
13 |
> index f9fa879..ca6a1f9 100644 |
14 |
> --- a/eclass/virtualx.eclass |
15 |
> +++ b/eclass/virtualx.eclass |
16 |
> @@ -90,22 +90,38 @@ esac |
17 |
> virtualmake() { |
18 |
> debug-print-function ${FUNCNAME} "$@" |
19 |
> |
20 |
> - local i=0 |
21 |
> - local retval=0 |
22 |
> - local OLD_SANDBOX_ON="${SANDBOX_ON}" |
23 |
> - local XVFB XHOST XDISPLAY |
24 |
> - local xvfbargs="-screen 0 1280x1024x24" |
25 |
> - XVFB=$(type -p Xvfb) || die |
26 |
> - XHOST=$(type -p xhost) || die |
27 |
> + [[ ${EAPI} == [2345] ]] || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx" |
28 |
> |
29 |
> # backcompat for maketype |
30 |
> if [[ -n ${maketype} ]]; then |
31 |
> + [[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5" |
32 |
> eqawarn "ebuild is exporting \$maketype=${maketype}" |
33 |
> eqawarn "Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead." |
34 |
> eqawarn "Setting VIRTUALX_COMMAND to \$maketype conveniently for now." |
35 |
> VIRTUALX_COMMAND=${maketype} |
36 |
> fi |
37 |
> |
38 |
> + virtx "${VIRTUALX_COMMAND}" "${@}" |
39 |
> +} |
40 |
> + |
41 |
> + |
42 |
> +# @FUNCTION: virtx |
43 |
> +# @USAGE: <command> [comman arguments] |
44 |
|
45 |
typo comman -> command |
46 |
|
47 |
> +# @DESCRIPTION: |
48 |
> +# Function which start new Xvfb session where the command gets executed. |
49 |
|
50 |
I'd drop "Function which" from the description. |
51 |
|
52 |
> +virtx() { |
53 |
> + debug-print-function ${FUNCNAME} "$@" |
54 |
> + |
55 |
> + [[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument" |
56 |
> + |
57 |
> + local i=0 |
58 |
> + local retval=0 |
59 |
> + local OLD_SANDBOX_ON="${SANDBOX_ON}" |
60 |
> + local XVFB XHOST XDISPLAY |
61 |
> + local xvfbargs="-screen 0 1280x1024x24" |
62 |
> + XVFB=$(type -p Xvfb) || die |
63 |
> + XHOST=$(type -p xhost) || die |
64 |
> + |
65 |
> debug-print "${FUNCNAME}: running Xvfb hack" |
66 |
> export XAUTHORITY= |
67 |
> # The following is derived from Mandrake's hack to allow |
68 |
> @@ -155,10 +171,10 @@ virtualmake() { |
69 |
> # to kill Xvfb |
70 |
> debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\"" |
71 |
> if has "${EAPI}" 2 3; then |
72 |
> - ${VIRTUALX_COMMAND} "$@" |
73 |
> + "$@" |
74 |
> retval=$? |
75 |
> else |
76 |
> - nonfatal ${VIRTUALX_COMMAND} "$@" |
77 |
> + nonfatal "$@" |
78 |
|
79 |
Please take the opportunity to clean this up, possibly only in EAPI=6 |
80 |
if you don't want to risk breaking existing ebuilds. See bug 517976 |
81 |
for details. |
82 |
|
83 |
> retval=$? |
84 |
> fi |
85 |
> |
86 |
> @@ -179,7 +195,7 @@ Xmake() { |
87 |
> debug-print-function ${FUNCNAME} "$@" |
88 |
> |
89 |
> [[ ${EAPI} == [2345] ]] \ |
90 |
> - || die "${FUNCNAME} is removed in EAPI > 5; use Xemake -j1 instead" |
91 |
> + || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'" |
92 |
> |
93 |
> eqawarn "you should not execute make directly" |
94 |
> eqawarn "rather execute Xemake -j1 if you have issues with parallel make" |
95 |
> @@ -192,6 +208,9 @@ Xmake() { |
96 |
> Xemake() { |
97 |
> debug-print-function ${FUNCNAME} "$@" |
98 |
> |
99 |
> + [[ ${EAPI} == [2345] ]] \ |
100 |
> + || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'" |
101 |
> + |
102 |
> VIRTUALX_COMMAND="emake" virtualmake "$@" |
103 |
> } |
104 |
> |
105 |
> @@ -201,6 +220,9 @@ Xemake() { |
106 |
> Xeconf() { |
107 |
> debug-print-function ${FUNCNAME} "$@" |
108 |
> |
109 |
> + [[ ${EAPI} == [2345] ]] \ |
110 |
> + || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'" |
111 |
> + |
112 |
> VIRTUALX_COMMAND="econf" virtualmake "$@" |
113 |
> } |
114 |
> |
115 |
> -- |
116 |
> 2.6.3 |
117 |
> |
118 |
> |