public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Davide Pesavento <pesa@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Justin Lecher <jlec@gentoo.org>
Subject: Re: [gentoo-dev] [PATCH 8/8] virtualx.eclass: Simplify API into single virtx()
Date: Sat, 28 Nov 2015 16:28:28 +0100	[thread overview]
Message-ID: <CADfzvvaP3tQTV7i+hJKSeG_30wcr2khgJWVNXmpxRJr1F-6MSQ@mail.gmail.com> (raw)
In-Reply-To: <1448717061-11581-9-git-send-email-jlec@gentoo.org>

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
>
>


  reply	other threads:[~2015-11-28 15:28 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADfzvvaP3tQTV7i+hJKSeG_30wcr2khgJWVNXmpxRJr1F-6MSQ@mail.gmail.com \
    --to=pesa@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=jlec@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox