Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 613602 - revdep-rebuild from app-portage/gentoolkit-0.3.2-r1 outputs colors even if make.conf has NOCOLOR true
Summary: revdep-rebuild from app-portage/gentoolkit-0.3.2-r1 outputs colors even if ma...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-23 07:42 UTC by Robert Wolf
Modified: 2022-07-12 01:25 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Wolf 2017-03-23 07:42:07 UTC
Hello,

the man page of revdep-rebuild from app-portage/gentoolkit-0.3.2-r1 says:

revdep-rebuild honors the NOCOLOR and PORTAGE_NICENESS variables from make.conf

In my /etc/portage/make.conf there is line:

NOCOLOR="true"

But the revdep-rebuild still outputs colors.

Is there some problem with my configuration or does revdep-rebuild just ignore this NOCOLOR from make.conf?

Thank you.

Regards,

Robert Wolf.
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2017-03-23 17:53:28 UTC
hmm, quick look at the code...

revdep itself has its own nocolor option, and will pass that to portage.  But it otherwise does not check what the state of it is for portage with setting loaded from make.conf.

Zac, whe portage is imported is the nocolor option setting from make.conf loaded and then can be used to pre-set revdep's cli option?
Comment 2 Robert Wolf 2017-03-24 10:00:34 UTC
(In reply to Brian Dolbec from comment #1)
> revdep itself has its own nocolor option, and will pass that to portage. 

*** Yes, I know. But I would like set it permanently. I have search man page for config file where I could set it and I have found the "revdep-rebuild honors the NOCOLOR and PORTAGE_NICENESS variables from make.conf"

> Zac, whe portage is imported is the nocolor option setting from make.conf
> loaded and then can be used to pre-set revdep's cli option?

*** I have found some code in equery and some other command to play with some settings with NOCOLOR, but I am not sure if this is really NOCOLOR from make.conf or some other NOCOLOR.

Thank you.

Regards,

Robert Wolf.
Comment 3 Paul Varner (RETIRED) gentoo-dev 2017-03-24 14:25:53 UTC
(In reply to Robert Wolf from comment #2)
> (In reply to Brian Dolbec from comment #1)
> > revdep itself has its own nocolor option, and will pass that to portage. 
> 
> *** Yes, I know. But I would like set it permanently. I have search man page
> for config file where I could set it and I have found the "revdep-rebuild
> honors the NOCOLOR and PORTAGE_NICENESS variables from make.conf"

The man page was written for the old version of revdep-rebuild (i.e. revdep-rebuild.sh). With that said, the goal is for the new Python version to have the same behaviors and options as the old version, except where not technically feasible. Where it is not feasible, we need to update the man page.

So yes, this a valid bug and Brian is investigating if it is technically feasible to implement in the Python version.
Comment 4 Robert Wolf 2017-03-24 15:40:47 UTC
(In reply to Paul Varner from comment #3)
> So yes, this a valid bug and Brian is investigating if it is technically
> feasible to implement in the Python version.

*** OK, thank you for confirmation.

It would be great, if you could support NOCOLOR from make.conf. Otherwise own config file with NOCOLOR should be good too. Or at least some ENV variable.

Thank you.

Regards,

Robert Wolf.
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2022-07-12 01:25:11 UTC
Current gentoolkit equery nocolor setting:

    # Guess color output
    if (
        CONFIG["color"] == -1
        and os.getenv("NOCOLOR") in ("yes", "true")
        or CONFIG["color"] == 0
    ):
        pp.output.nocolor()

    if CONFIG["piping"]:
        CONFIG["verbose"] = False
        # set extra wide, should disable wrapping unless
        # there is some extra long text
        CONFIG["termWidth"] = 600
        # turn off color
        pp.output.nocolor()

It looks for a NOCOLOR setting from the environment.  So, just add it to your .bashrc.

Adding in code for importing the portage module to get the make.conf setting at this early stage would only slow the run time further.  Likely not worth the effort.   Certain parts of the various modules do load in portage and can get it easily, but not all modules require portage code imports.