• [gentoo-dev] [PATCH] python-utils-r1.eclass: avoid nested ebegin calls

    From Mike Gilbert@21:1/5 to All on Mon Jul 11 06:00:01 2022
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..acfa83d5e18 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,8 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    + einfo " python_check_deps"
    python_check_deps
    - eend ${?}
    }

    # @FUNCTION: python_has_version
    --
    2.37.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Mike Gilbert on Mon Jul 11 09:10:01 2022
    On Sun, 2022-07-10 at 23:53 -0400, Mike Gilbert wrote:
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..acfa83d5e18 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,8 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    + einfo " python_check_deps"
    python_check_deps
    - eend ${?}
    }

    # @FUNCTION: python_has_version

    What's the harm in nesting them?

    --
    Best regards,
    Michał Górny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to mgorny@gentoo.org on Mon Jul 11 13:40:01 2022
    On Mon, Jul 11, 2022 at 3:04 AM Michał Górny <mgorny@gentoo.org> wrote:

    On Sun, 2022-07-10 at 23:53 -0400, Mike Gilbert wrote:
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..acfa83d5e18 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,8 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    + einfo " python_check_deps"
    python_check_deps
    - eend ${?}
    }

    # @FUNCTION: python_has_version

    What's the harm in nesting them?

    It results in strange looking output, and triggers a QA warning in the
    latest version of Portage.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Mike Gilbert on Mon Jul 11 14:50:01 2022
    On Mon, 2022-07-11 at 07:36 -0400, Mike Gilbert wrote:
    On Mon, Jul 11, 2022 at 3:04 AM Michał Górny <mgorny@gentoo.org> wrote:

    On Sun, 2022-07-10 at 23:53 -0400, Mike Gilbert wrote:
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
    index a18ca58475f..acfa83d5e18 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,8 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    + einfo " python_check_deps"
    python_check_deps
    - eend ${?}
    }

    # @FUNCTION: python_has_version

    What's the harm in nesting them?

    It results in strange looking output, and triggers a QA warning in the
    latest version of Portage.

    This change means that if python_check_deps() isn't verbose and returns
    false, we have no output that it failed. At least make it print
    the result verbosely then.

    --
    Best regards,
    Michał Górny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to All on Mon Jul 11 15:20:01 2022
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 9 ++++++---
    1 file changed, 6 insertions(+), 3 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..5c678c524ae 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,12 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    # @FUNCTION: python_has_version
    --
    2.37.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Mike Gilbert on Mon Jul 11 16:30:01 2022
    On Mon, 2022-07-11 at 09:16 -0400, Mike Gilbert wrote:
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 9 ++++++---
    1 file changed, 6 insertions(+), 3 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..5c678c524ae 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,12 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    # @FUNCTION: python_has_version

    WFM. Please don't push it yet, I'll ask ionen to add it on top of his
    patchset for a single merge.

    --
    Best regards,
    Michał Górny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Mon Jul 11 19:00:01 2022
    On Mon, 11 Jul 2022, Ionen Wolkens wrote:
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    I was about to go about merging this as suggested, but this masks the
    return value, and then things like this always succeed:

    if _python_run_check_deps "${impl}"; then

    Maybe leave ebegin/eend in place then, which was invented precisely for
    this use case? What's so bad about nesting it?

    Ulrich

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmLMVj8PHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4u8O4IALRggniNaNqqq+TUsfXAqZzkijMUQHVaFPbf GGfXCV/mIAJx4E9ebrS9gEtLveKPTB304vJGD5nMw/eoYE/B09wmspVWSCSn5aod JSXKeeQJLFHQKVGG+SrQTTcAW4TeDn73dvdpLEAcDtgAp6rA7dD9WLuhHZ8qwqjl YXSFbmwjsFNgGXVlsycGpsMaoZwvEm44T2Y5H8kcu3y1ALrP4kZ7q3tkEbxV+SXf k2MP2r9yUHxsnKvvn+MmWRpPvBUB0nKvZ68KcHrbnxHJlRI2ef9nxrDjgNfki6Lo fzTjP2SqZ7mTKNRBE0Jx1lnV2i/0rZnLf/OpfUmqieXdddKkHAE=
    =bmLl
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Mike Gilbert on Mon Jul 11 18:20:02 2022
    On Mon, Jul 11, 2022 at 09:16:10AM -0400, Mike Gilbert wrote:
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 9 ++++++---
    1 file changed, 6 insertions(+), 3 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..5c678c524ae 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,12 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    I was about to go about merging this as suggested, but this masks the
    return value, and then things like this always succeed:

    if _python_run_check_deps "${impl}"; then


    # @FUNCTION: python_has_version
    --
    2.37.0



    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmLMS6wACgkQskQGsLCs QzRM+Af9ECO5Y6evCcY14eQhxapfYPIDjp4WtnLe/YmdjxIqcgVY4eKYN9ysd37P MqyniCXWWl4HFaWwDemP1EbHqSvu5nWv7ccaakbTZ0QkcYPCPlRlFKqPraP8KbUX 8Ea8l8yktIrVbRr0wdAx0wJS66PgL1jCjWxAggL3Hi6M6WE9A9dVYfAGm42/gRYA f78RfqT/iLSwjKkNR+DXPKEYCAyOKlLMWDuWuxkQJoKh9hzrZRus+oYd0oBwKHzP N6qxuWTKDtXo+vwI9h4eeKt4vyIsmmErBVk96hkoJm5toHtaAYdy1ILFu1964S+U VbQxUb9US5uaEbhMId+xCa/8jKLi+w==
    =xzNo
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to ulm@gentoo.org on Mon Jul 11 19:10:01 2022
    On Mon, Jul 11, 2022 at 12:56 PM Ulrich Mueller <ulm@gentoo.org> wrote:

    On Mon, 11 Jul 2022, Ionen Wolkens wrote:
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    I was about to go about merging this as suggested, but this masks the return value, and then things like this always succeed:

    if _python_run_check_deps "${impl}"; then

    Maybe leave ebegin/eend in place then, which was invented precisely for
    this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to ionen@gentoo.org on Mon Jul 11 19:20:01 2022
    On Mon, Jul 11, 2022 at 12:11 PM Ionen Wolkens <ionen@gentoo.org> wrote:

    On Mon, Jul 11, 2022 at 09:16:10AM -0400, Mike Gilbert wrote:
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 9 ++++++---
    1 file changed, 6 insertions(+), 3 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..5c678c524ae 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,12 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    I was about to go about merging this as suggested, but this masks the
    return value, and then things like this always succeed:

    if _python_run_check_deps "${impl}"; then

    Thanks for catching that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Mike Gilbert on Mon Jul 11 19:20:01 2022
    On Mon, Jul 11, 2022 at 01:08:52PM -0400, Mike Gilbert wrote:
    On Mon, Jul 11, 2022 at 12:56 PM Ulrich Mueller <ulm@gentoo.org> wrote:

    On Mon, 11 Jul 2022, Ionen Wolkens wrote:
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    I was about to go about merging this as suggested, but this masks the return value, and then things like this always succeed:

    if _python_run_check_deps "${impl}"; then

    Maybe leave ebegin/eend in place then, which was invented precisely for this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7


    Isn't that a portage problem? I don't think stopping legitimate use
    because portage displays messages weird is the right thing to do but
    should rather improve how portage displays them in this situation.

    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmLMWzUACgkQskQGsLCs QzRPOggAliLPCGfx/ImoUHz8gyAcqgYtSCXq2Idfv5OLftGgMkSyaI/ng3Tcf7Lr nJIUmBUDseujcdlrlzMEHuhK+SoXIC+Xk87eKlNytQ6+zT9JFCdsvrFOGmWa2Kkd VqAASiroaCInXdMZfmHlkYPg58Dp/nOgBgg7W6aUfD+1Jo3597iwBlA3T5QnrJHg 7C6AgbMN4hvr3dOEZ/bpiHxF5zNMSQVcnwP4jNBm/UIkY1MQTCHxuPaMTuimKmAS 3VRr/t5kI+52Dz4pzIDZU2DKWFKwHSyt8glf99Y7GHXOljsuoSUX19q3wVhgZ5vQ H9p80pcUDrkjLV0+dyGou1xfB4IMBA==
    =M1Ss
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to ionen@gentoo.org on Mon Jul 11 19:30:01 2022
    On Mon, Jul 11, 2022 at 1:17 PM Ionen Wolkens <ionen@gentoo.org> wrote:

    On Mon, Jul 11, 2022 at 01:08:52PM -0400, Mike Gilbert wrote:
    On Mon, Jul 11, 2022 at 12:56 PM Ulrich Mueller <ulm@gentoo.org> wrote:

    On Mon, 11 Jul 2022, Ionen Wolkens wrote:
    - ebegin " python_check_deps"
    - python_check_deps
    - eend ${?}
    + einfo " python_check_deps"
    + if python_check_deps; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    }

    I was about to go about merging this as suggested, but this masks the return value, and then things like this always succeed:

    if _python_run_check_deps "${impl}"; then

    Maybe leave ebegin/eend in place then, which was invented precisely for this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7


    Isn't that a portage problem? I don't think stopping legitimate use
    because portage displays messages weird is the right thing to do but
    should rather improve how portage displays them in this situation.

    What is a "good" way to display it? I don't really think you can make ebegin/eend look good when there are lines of output between them.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to All on Mon Jul 11 19:20:01 2022
    It's common for python_check_deps to call python_has_version, which
    calls ebegin itself.

    Closes: https://bugs.gentoo.org/851822
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index a18ca58475f..ab59db9954e 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1399,9 +1399,15 @@ _python_run_check_deps() {

    local PYTHON_USEDEP="python_targets_${impl}(-)"
    local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
    - ebegin " python_check_deps"
    + einfo " python_check_deps"
    python_check_deps
    - eend ${?}
    + local status=$?
    + if [[ ${status} -eq 0 ]]; then
    + einfo " python_check_deps succeeded"
    + else
    + einfo " python_check_deps failed"
    + fi
    + return ${status}
    }

    # @FUNCTION: python_has_version
    --
    2.37.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anna@21:1/5 to Ulrich Mueller on Mon Jul 11 20:10:01 2022
    On 2022-07-11 19:57, Ulrich Mueller wrote:
    On Mon, 11 Jul 2022, Mike Gilbert wrote:

    Maybe leave ebegin/eend in place then, which was invented precisely for
    this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    IIUC it would look like this, with the patch applied:

    * task 1
    * Doing task 2 ... [ ok ]
    * task 1 succeeded

    That's not the most beautiful of outputs either.

    I think ebegin/eend output should be buffered so it can be nested
    properly.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Mon Jul 11 20:00:01 2022
    On Mon, 11 Jul 2022, Mike Gilbert wrote:

    Maybe leave ebegin/eend in place then, which was invented precisely for
    this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    IIUC it would look like this, with the patch applied:

    * task 1
    * Doing task 2 ... [ ok ]
    * task 1 succeeded

    That's not the most beautiful of outputs either.

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmLMZIIPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uemkH/1n+a7zCIWEmbT+jk0Aubaf0fpB7/iCZvFvC 5v7dXb1IXszNelWM+dP8nXP31WpNsXlzQ+3kh5EY1IUpBex8ujnWuG3Nq43LE+Ib SOyKQLI2JO1hEGAZFewgn/k7BMmOygfX5q2NfJWGoLXfg9OVQBE12GOFq+dsiWEQ 80OFk4crroG91hiR4KeCq8FzlVeP61SdKqWYks6lBYjUVl8BbxFvLupc8CV91SLj yuiIbDpX95D2eW4KFSlLvfoK6Rw3nnH4k5/rFIBdNdTiZpbyLBirEVjjQm3gJdwI uIaAOImkeFNQjwoeL736dFn/NKpKA6QWIQijj4TNy+MxqHKZnRo=
    =Fj02
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to frederik.pfautsch@fpprogs.de on Mon Jul 11 21:10:01 2022
    On Mon, Jul 11, 2022 at 2:49 PM Frederik Pfautsch <frederik.pfautsch@fpprogs.de> wrote:

    Am 11.07.22 um 20:14 schrieb Mike Gilbert:
    On Mon, Jul 11, 2022 at 1:57 PM Ulrich Mueller <ulm@gentoo.org> wrote:

    On Mon, 11 Jul 2022, Mike Gilbert wrote:

    Maybe leave ebegin/eend in place then, which was invented precisely for >>>> this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    IIUC it would look like this, with the patch applied:

    * task 1
    * Doing task 2 ... [ ok ]
    * task 1 succeeded

    That's not the most beautiful of outputs either.

    Right. I would prefer to apply the first patch I submitted instead.

    How about output like:

    * Doing task 1 ...

    | * Doing task 2 ...

    | \> [ ok ]

    |

    | additional log from task 1

    | line 2 of task 1 log

    \> [ !! ]

    This would require keeping track of the current "indentation"
    level/prepend "| " to each output for every level. But not sure if is possible/how difficult it is to implement. Just sort of a quick idea.

    That seems like it would be somewhat involved to implement, and it
    seems like a lot of complexity to solve relatively minor problem.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to cyber+gentoo@sysrq.in on Mon Jul 11 20:30:01 2022
    On Mon, Jul 11, 2022 at 2:01 PM Anna <cyber+gentoo@sysrq.in> wrote:

    On 2022-07-11 19:57, Ulrich Mueller wrote:
    On Mon, 11 Jul 2022, Mike Gilbert wrote:

    Maybe leave ebegin/eend in place then, which was invented precisely for >> this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    IIUC it would look like this, with the patch applied:

    * task 1
    * Doing task 2 ... [ ok ]
    * task 1 succeeded

    That's not the most beautiful of outputs either.

    I think ebegin/eend output should be buffered so it can be nested
    properly.


    My take: the main purpose of ebegin is to inform the user that we are
    starting a silent long-running task. eend tells you the result of that
    task.

    Buffering ebegin calls would sort of defeat that purpose of informing
    the user that something is happening.

    In other words, I don't think it makes sense to call ebegin before
    starting a task that is expected to produce output. This includes
    tasks that call ebegin themselves, since ebegin always produces
    output.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frederik Pfautsch@21:1/5 to Mike Gilbert on Mon Jul 11 20:50:02 2022
    Copy: gentoo-dev@lists.gentoo.org

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------L2hB0BrSo7VxNVJk80tuZqlf
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64

    QW0gMTEuMDcuMjIgdW0gMjA6MTQgc2NocmllYiBNaWtlIEdpbGJlcnQ6DQo+IE9uIE1vbiwg SnVsIDExLCAyMDIyIGF0IDE6NTcgUE0gVWxyaWNoIE11ZWxsZXIgPHVsbUBnZW50b28ub3Jn PiB3cm90ZToNCj4+DQo+Pj4+Pj4+IE9uIE1vbiwgMTEgSnVsIDIwMjIsIE1pa2UgR2lsYmVy dCB3cm90ZToNCj4+DQo+Pj4+IE1heWJlIGxlYXZlIGViZWdpbi9lZW5kIGluIHBsYWNlIHRo ZW4sIHdoaWNoIHdhcyBpbnZlbnRlZCBwcmVjaXNlbHkgZm9yDQo+Pj4+IHRoaXMgdXNlIGNh c2U/IFdoYXQncyBzbyBiYWQgYWJvdXQgbmVzdGluZyBpdD8NCj4+DQo+Pj4gSXQgbGVhZHMg dG8gb2RkIGxvb2tpbmcgb3V0cHV0Lg0KPj4NCj4+PiBodHRwczovL2dpdHdlYi5nZW50b28u b3JnL3Byb2ovcG9ydGFnZS5naXQvY29tbWl0Lz9pZD1lYmEwODhhZjhmMzM1YzBhZGIzODY0 NjFlNmRmMTI2N2UyNDgwMGU3DQo+Pg0KPj4gSUlVQyBpdCB3b3VsZCBsb29rIGxpa2UgdGhp cywgd2l0aCB0aGUgcGF0Y2ggYXBwbGllZDoNCj4+DQo+PiAgICogICB0YXNrIDENCj4+ICAg KiBEb2luZyB0YXNrIDIgLi4uIFsgb2sgXQ0KPj4gICAqICAgdGFzayAxIHN1Y2NlZWRlZA0K Pj4NCj4+IFRoYXQncyBub3QgdGhlIG1vc3QgYmVhdXRpZnVsIG9mIG91dHB1dHMgZWl0aGVy Lg0KPiANCj4gUmlnaHQuIEkgd291bGQgcHJlZmVyIHRvIGFwcGx5IHRoZSBmaXJzdCBwYXRj aCBJIHN1Ym1pdHRlZCBpbnN0ZWFkLg0KDQpIb3cgYWJvdXQgb3V0cHV0IGxpa2U6DQoNCiAg KiBEb2luZyB0YXNrIDEgLi4uDQoNCiAgfCAgKiBEb2luZyB0YXNrIDIgLi4uDQoNCiAgfCAg XD4gWyBvayBdDQoNCiAgfA0KDQogIHwgYWRkaXRpb25hbCBsb2cgZnJvbSB0YXNrIDENCg0K ICB8IGxpbmUgMiBvZiB0YXNrIDEgbG9nDQoNCiAgXD4gWyAhISBdDQoNClRoaXMgd291bGQg cmVxdWlyZSBrZWVwaW5nIHRyYWNrIG9mIHRoZSBjdXJyZW50ICJpbmRlbnRhdGlvbiIgDQps ZXZlbC9wcmVwZW5kICJ8ICIgdG8gZWFjaCBvdXRwdXQgZm9yIGV2ZXJ5IGxldmVsLiBCdXQg bm90IHN1cmUgaWYgaXMgDQpwb3NzaWJsZS9ob3cgZGlmZmljdWx0IGl0IGlzIHRvIGltcGxl bWVudC4gSnVzdCBzb3J0IG9mIGEgcXVpY2sgaWRlYS4NCg==

    --------------L2hB0BrSo7VxNVJk80tuZqlf--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQRIToWbAVczYFedsuvy6cPNmp1pXQUCYsxwswUDAAAAAAAKCRDy6cPNmp1pXWHm AP47sT+I5zKORO0Xdn8fIh8ep8ENIbN6Afsb/MqJAr/r2QEAxVApDS53mKU1ntLPMtYtisenddeY svcilVC7AqeKGwA=
    =FmhN
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to ulm@gentoo.org on Mon Jul 11 20:20:01 2022
    On Mon, Jul 11, 2022 at 1:57 PM Ulrich Mueller <ulm@gentoo.org> wrote:

    On Mon, 11 Jul 2022, Mike Gilbert wrote:

    Maybe leave ebegin/eend in place then, which was invented precisely for
    this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    IIUC it would look like this, with the patch applied:

    * task 1
    * Doing task 2 ... [ ok ]
    * task 1 succeeded

    That's not the most beautiful of outputs either.

    Right. I would prefer to apply the first patch I submitted instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to floppym@gentoo.org on Mon Jul 11 21:20:01 2022
    On Mon, Jul 11, 2022 at 2:20 PM Mike Gilbert <floppym@gentoo.org> wrote:

    On Mon, Jul 11, 2022 at 2:01 PM Anna <cyber+gentoo@sysrq.in> wrote:

    On 2022-07-11 19:57, Ulrich Mueller wrote:
    On Mon, 11 Jul 2022, Mike Gilbert wrote:

    Maybe leave ebegin/eend in place then, which was invented precisely for
    this use case? What's so bad about nesting it?

    It leads to odd looking output.

    https://gitweb.gentoo.org/proj/portage.git/commit/?id=eba088af8f335c0adb386461e6df1267e24800e7

    IIUC it would look like this, with the patch applied:

    * task 1
    * Doing task 2 ... [ ok ]
    * task 1 succeeded

    That's not the most beautiful of outputs either.

    I think ebegin/eend output should be buffered so it can be nested
    properly.


    My take: the main purpose of ebegin is to inform the user that we are starting a silent long-running task. eend tells you the result of that
    task.

    Buffering ebegin calls would sort of defeat that purpose of informing
    the user that something is happening.

    In other words, I don't think it makes sense to call ebegin before
    starting a task that is expected to produce output. This includes
    tasks that call ebegin themselves, since ebegin always produces
    output.

    I've decided this is a hill I don't want to die on, so I've submitted
    a PR to update the QA check.

    https://github.com/gentoo/portage/pull/854

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)