sys-apps/gentoo-functions supports eindent and eoutdent to modify the behaviour of einfo and friends ("Output commands" listed in "12.3.5 Output commands"). eindent increases the indentation level of subsequent commands, while eoutdent decrements it. The latest usecase that came up was possibly in Python eclasses where phases get repeated for each Python implementation, like: ``` * python3_12: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.12/site-packages * python3_13: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.13/site-packages * python3_14: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.14/site-packages ``` instead of the current: ``` * python3_12: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.12/site-packages * python3_13: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.13/site-packages * python3_14: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.14/site-packages ``` I think it has some natural usecases in anything multilib/many impl but also functions which iterate by depth or similar. Unfortunately, it's not really possible to testdrive this via an eclass because of how the other functions are implemented.
I don't really have a strong opinion on this, but one argument for implementing it would be consistency with how e* functions are used elsewhere.
We have done without this for a quarter century. So unless someone convinces me that this is in a category more important than "nice to have", I'd rather postpone it to EAPI 10.
Unfortunately, gentoo-functions and OpenRC have different APIs: In sys-apps/gentoo-functions (as of version 1.7.3) these functions accept an optional argument specifying the indentation step. If no argument is specified, or if it is <= 0, a default of 2 is used. sys-apps/openrc (as of version 0.62.2) uses a fixed value of 2. It also does this: : $(( EINFO_INDENT = ${EINFO_INDENT:-0} + 2 )) [ "$EINFO_INDENT" -gt 40 ] && EINFO_INDENT=40 Which is flawed: If the limit is hit, then the next eoutdent will immediately reduce indentation starting from 40, i.e. it won't align with its corresponding eindent. Looking at the implementation of _eindent() in libeinfo.c, it looks like the limit isn't even needed, because _eindent does its own limitation of the width.
(In reply to Sam James from comment #0) > The latest usecase that came up was possibly in Python eclasses where phases > get repeated for each Python implementation, like: > ``` > * python3_12: running distutils-r1_run_phase python_install > * Optimize Python modules in /usr/lib/python3.12/site-packages > * python3_13: running distutils-r1_run_phase python_install > * Optimize Python modules in /usr/lib/python3.13/site-packages > * python3_14: running distutils-r1_run_phase python_install > * Optimize Python modules in /usr/lib/python3.14/site-packages > ``` This is not how it is implemented in gentoo-functions and OpenRC. For both, output looks like this: * python3_12: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.12/site-packages * python3_13: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.13/site-packages * python3_14: running distutils-r1_run_phase python_install * Optimize Python modules in /usr/lib/python3.14/site-packages That is, indentation is by 2 chars and starts after the asterisk.
(In reply to Ulrich Müller from comment #4) > > This is not how it is implemented in gentoo-functions and OpenRC. For both, > output looks like this: > > * python3_12: running distutils-r1_run_phase python_install > * Optimize Python modules in /usr/lib/python3.12/site-packages > [...] > That is, indentation is by 2 chars and starts after the asterisk. I suppose I prefer that, I was just going off memory :)
(In reply to Ulrich Müller from comment #3) > sys-apps/openrc does this: > > : $(( EINFO_INDENT = ${EINFO_INDENT:-0} + 2 )) > [ "$EINFO_INDENT" -gt 40 ] && EINFO_INDENT=40 > > Which is flawed: If the limit is hit, then the next eoutdent will > immediately reduce indentation starting from 40, i.e. it won't align with > its corresponding eindent. Fixed: https://github.com/OpenRC/openrc/commit/4fdb883a3dc42fd9f76a3e19db66313fae9adb19