I have a script that equery lists installed versions of a few packages, checking them against a stored list. It pipes equery -N output to a sed filter, with the -N there to keep full colored output despite the pipe to sed.
Running the script today I noticed the output wasn't colored any longer for the current output. Testing the bare equery -N at the commandline revealed that it kept colored output, while feeding it to cat to test the piped output without the sed complicating things killed the color.
So equery -N no longer seems to do what it says on the tin (aka in the manpage). The installed gentoolkit was 0.6.1-r3.
I checked my binpkgs and still had 0.6.1-r2 and 0.5.1-r1. Reverting to 0.6.1-r2 yielded the same result, while reverting to 0.5.1-r1 gave me back a working equery -N with my expected colored output.
 The script is to compare installed versions against those I had when I last updated my initramfs, as well as against the versions for the previous (backup) initramfs. On the initial run today, it didn't color the current installed but was still coloring both stored lists. After the initramfs update it failed to color both the current installed and the newest stored list, which of course had just been generated by the update, but the backup list was still colored. Presumably running it again (if I hadn't reverted to 0.5.1-r1) would kill the color on the backup list as well.
Could you bisect?
(In reply to Sam James from comment #1)
> Could you bisect?
Bisects to (unsurprisingly given the description)...
commit 84ffe42e5 (refs/git-r3/app-portage/gentoolkit/0/__old__, refs/git-r3/app-portage/gentoolkit/0/__main__)
Author: Brian Dolbec <dolsen@>
AuthorDate: Sat Jul 9 18:06:50 2022 -0700
Commit: Brian Dolbec <dolsen@>
CommitDate: Sat Jul 9 18:06:50 2022 -0700
equery: Turn off color when piping is set
Signed-off-by: Brian Dolbec <dolsen@>
pym/gentoolkit/equery/__init__.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pym/gentoolkit/equery/__init__.py b/pym/gentoolkit/equery/__init__.py
index cecb5bee3..56b2caaad 100644
@@ -228,6 +228,8 @@ def initialize_configuration():
# set extra wide, should disable wrapping unless
# there is some extra long text
CONFIG["termWidth"] = 600
+ # turn off color
CONFIG["debug"] = bool(os.getenv("DEBUG", False))
I've not looked at the larger context but apparently that's unconditional re: -N, and shouldn't be.
The bug has been referenced in the following commit(s):
Author: Brian Dolbec <email@example.com>
AuthorDate: 2022-07-28 15:22:55 +0000
Commit: Brian Dolbec <firstname.lastname@example.org>
CommitDate: 2022-07-28 15:22:55 +0000
equery: Set nocolor for piping to after options are parsed
Fixes commit 84ffe42e5 which set nocolor before options were parsed.
Signed-off-by: Brian Dolbec <email@example.com>
pym/gentoolkit/equery/__init__.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)