Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 02 Aug 2022 04:04:16
Message-Id: 1659413020.3020036e18b7408ea7f01ecac4eb09972466aa3a.mgorny@gentoo
1 commit: 3020036e18b7408ea7f01ecac4eb09972466aa3a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 8 06:41:58 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 04:03:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3020036e
7
8 virtualx.eclass: Inline XVFB
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/virtualx.eclass | 15 +++++++--------
13 1 file changed, 7 insertions(+), 8 deletions(-)
14
15 diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
16 index 05b89e814a42..d1c05e20b246 100644
17 --- a/eclass/virtualx.eclass
18 +++ b/eclass/virtualx.eclass
19 @@ -108,9 +108,8 @@ virtx() {
20 local i=0
21 local retval=0
22 local OLD_SANDBOX_ON="${SANDBOX_ON}"
23 - local XVFB XDISPLAY
24 + local XDISPLAY
25 local xvfbargs=( -screen 0 1280x1024x24 +extension RANDR )
26 - XVFB=$(type -p Xvfb) || die
27
28 debug-print "${FUNCNAME}: running Xvfb hack"
29 export XAUTHORITY=
30 @@ -133,24 +132,24 @@ virtx() {
31 # We really do not want SANDBOX enabled here
32 export SANDBOX_ON="0"
33
34 - debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs[*]}"
35 - ${XVFB} :${XDISPLAY} "${xvfbargs[@]}" &>/dev/null &
36 + debug-print "${FUNCNAME}: Xvfb :${XDISPLAY} ${xvfbargs[*]}"
37 + Xvfb :${XDISPLAY} "${xvfbargs[@]}" &>/dev/null &
38 sleep 2
39
40 local start=${XDISPLAY}
41 while [[ ! -f /tmp/.X${XDISPLAY}-lock ]]; do
42 # Stop trying after 15 tries
43 if ((XDISPLAY - start > 15)) ; then
44 - eerror "'${XVFB} :${XDISPLAY} ${xvfbargs[*]}' returns:"
45 + eerror "'Xvfb :${XDISPLAY} ${xvfbargs[*]}' returns:"
46 echo
47 - ${XVFB} :${XDISPLAY} "${xvfbargs[@]}"
48 + Xvfb :${XDISPLAY} "${xvfbargs[@]}"
49 echo
50 eerror "If possible, correct the above error and try your emerge again."
51 die "Unable to start Xvfb"
52 fi
53 ((XDISPLAY++))
54 - debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs[*]}"
55 - ${XVFB} :${XDISPLAY} "${xvfbargs[@]}" &>/dev/null &
56 + debug-print "${FUNCNAME}: Xvfb :${XDISPLAY} ${xvfbargs[*]}"
57 + Xvfb :${XDISPLAY} "${xvfbargs[@]}" &>/dev/null &
58 sleep 2
59 done