From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 422021384B4 for ; Sat, 28 Nov 2015 15:28:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BE7821C0C0; Sat, 28 Nov 2015 15:28:51 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3A2C1E08DA for ; Sat, 28 Nov 2015 15:28:50 +0000 (UTC) Received: by lfs39 with SMTP id 39so152156244lfs.3 for ; Sat, 28 Nov 2015 07:28:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=XPKnnHo2UpdqkvpIveh6ucrsYhqY+8xxvDPTV3tec/E=; b=j0vPmtHmClGse6a+mH/Klgom94okyZodfkBPqyiKJr2Hez/Drin1wrFr1o5ZA30B2f zl+Cc/OQbh6kwbTAJ431wQAU6c8GCZCifRJGcqRAzIEklaQemTGnsLSVHAVfPw8rasuU UE3Tb3gScixxKseR1XnIA3xcTvvoi8eaxIJmkyMVqLJUPImBhOxYQqdZPRm0IS7qn6hQ V50ijujYaUkftk1GI0G5m63bcjF80THZZ/wCTxrULJ2z3EujRBlnwIwFF37EfpqkXBcZ R6DbHfTrACIfuXbGNv34xBcyeqQx77WWfdlow3n89PlBLHfWw09QJIuJcCgWvC6Xrjw1 f6ag== X-Received: by 10.112.138.38 with SMTP id qn6mr15614996lbb.29.1448724528502; Sat, 28 Nov 2015 07:28:48 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Sender: davidepesa@gmail.com Received: by 10.112.137.232 with HTTP; Sat, 28 Nov 2015 07:28:28 -0800 (PST) In-Reply-To: <1448717061-11581-9-git-send-email-jlec@gentoo.org> References: <1448717061-11581-1-git-send-email-jlec@gentoo.org> <1448717061-11581-9-git-send-email-jlec@gentoo.org> From: Davide Pesavento Date: Sat, 28 Nov 2015 16:28:28 +0100 X-Google-Sender-Auth: qE2AkEIpq-IOSex_ciXmyQyuLGw Message-ID: Subject: Re: [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx() To: gentoo-dev@lists.gentoo.org Cc: Justin Lecher Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 1447610f-5ece-42f4-86fb-8f9bfd187637 X-Archives-Hash: ee6eb9b4eca95b38fdae834dbec7ab4b On Sat, Nov 28, 2015 at 2:24 PM, Justin Lecher 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 > --- > 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: [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 > >