Summary: | PORTAGE_DEBUG should output USE flags in use() | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Wout Mertens (RETIRED) <wmertens> |
Component: | Core - Ebuild Support | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | radek |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Wout Mertens (RETIRED)
![]() this line doesn't seem to exist in -r3 any more. as for the subshell thing, you are quite right -- I think the reason of the if [ "``"] syntax is that the use flag itself is not output to stdout during emerge. I guess a use blah &>/dev/null syntax might solve that? Yep. Alternatively we might do something like: ----------------------------------------- use_debug () { if [ -z "$1" ]; then return 0 fi if [ ! -z "${PORTAGE_DEBUG}" ]; then use $* &> /dev/null return $? else use $* return &? fi } ---------------------------------- Might be a nice feature to portage, as then you could just use: if use_debug foo; then ..... and it will print the use flags if you have PORTAGE_DEBUG set ... Thoughts ? I like that, actually -- I always thought it rather silly that portage just outputs the USE flags. I'd like to propose a 3-phase plan for this change:1 use_debug is written, all ebuild authors are told to use it instead of use, in the way outlined above2 use() is deprecated, with the function reporting an error so that all ebuilds are fixed3 use_debug is renamed to use and we do a sed pass over all ebuilds.Or is this too much work?Another possibility is to make use() silent and fix all broken ebuilds by adding USE_DEBUG=1 to the beginning... use_debug is not a reasonable name to move to. And use() works fine. Adding more debug to it is possible, but don't you see that when you use 'emerge --debug' ? Sorry about the badly formatted comment above. Ok, I must admit that use() works fine, and there is truth in "If it isn't broken, don't fix it". On the other side, ebuilds now contain horrors like 'if [ "`use foo`" ]'. This means that you cannot make use() be silent until you fix those ebuilds to use 'if use foo'. So the main question is: Do we dislike the fact that the use flags are echoed to the user enough to fix it? I vote yes. Here's my latest proposal: - change skel.ebuild to explain how to test for a use flag (if use foo) - add USE_SILENT=1 to skel.ebuild - change use so it doesn't echo when USE_SILENT is set to 1, and echo always if USE_DEBUG=1. Then, in a year or so, we can look at all ebuilds that don't have USE_SILENT in them, change them to contain USE_DEBUG=1, and remove USE_SILENT from everywhere. Seems like the least amount of work and it will give us prettier ebuilds. Prettiness really shouldn't be a factor. Supporting both sides of this coin is to allow things to ease a few actions regarding the use of use flags in expantions. I very much dislike [ "" ] syntax. The output isn't hurting anyone and is only visible if it's printing on your primary terminal. Turn logging on and you won't see it very often. If all the instances of `use` are removed from all the ebuilds, I can probably kill that functionality in the near future. i sometimes use the fact it echos the flag in code ... for example: for disp in `use X` `use sdl` `use svga` ; do echo $disp done we now have a first step with use (always verbose) and useq (silent), next step is to get everyone to use useq and add the debug logic to it. use -> quiet usev -> verbose useq -> quiet |