Summary: | [PATCH] PORTAGE_QUIET= (suppress screen output for scripts) | ||
---|---|---|---|
Product: | Portage Development | Reporter: | solar (RETIRED) <solar> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | minor | Keywords: | InVCS |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 115839 | ||
Attachments: |
herds.py
metadata.py quiet.patch ebuild.sh patch newer patch |
Description
solar (RETIRED)
![]() sed s/PORTAGE_QUIET/PORTAGE_SCRIPT/g <-- sounds better poke poke.. Can you/I commit this? Would be better as a -qqq enhancement. -qqq ? The case for this is so that other scripts can import the portage module via python without having the writemsg() triggered. Not using the emerge interface at all. I'll attach those as examples in a min. Created attachment 40140 [details]
herds.py
Exmaple which extracts people from herds from gentoo's herds.xml
Created attachment 40141 [details]
metadata.py
Example tool which extracts maintainer/longdescription/herd/email from a
metadata.xml
These two files are what allows me to have jeeves (your fav bot) display to irc
!metadata <pkgname>
!herd <herdname>
But in the future if anybody upgrades portage on eagle without some way to
supress output we would either have to reedit portage.py again or add the bot
to the portage group which a bot should not really be in for security sake.
So back to the orig topic. Portage needs to be quiet for scripts. Perferable the answer the problem is not. sys.stderr=open("/dev/null","w") Index: emerge =================================================================== --- emerge (revision 2482) +++ emerge (working copy) @@ -326,6 +326,7 @@ if ("--quiet" in myopts): update_spinner = update_quiet_spinner + os.environ["PORTAGE_QUIET"] = "1" # Always create packages if FEATURES=buildpkg # Imply --buildpkg if --buildpkgonly r2483 has the above patch. calls from portage.py can now make use of this variable and we can now hush quite a few things up. I'll start working on an overall quiet mode for portage/emerge/ebuild.sh now Created attachment 75564 [details, diff]
quiet.patch
This is what I'm thinking of doing in places to reduce the noise.
The portage/python parts are in. ebuild.sh itself has not been made quiet. The easy way todo that in ebuild.sh is to add a wrapper function for general non critical error msgs Created attachment 84739 [details, diff] ebuild.sh patch hope this is what you were after. sample output: $ emerge -q gcc-config >>> Emerging (1 of 1) sys-devel/gcc-config-1.3.13-r1 to / * Switching native-compiler to x86_64-pc-linux-gnu-3.4.5 ... [ ok ] >>> No packages selected for removal by clean. >>> Auto-cleaning packages... >>> No outdated packages were found on your system. With that patch, pretty much everything that isn't critical gets suppressed. Created attachment 84791 [details, diff]
newer patch
replaced eecho with vecho as it seems more appropriate and solar would have to change ~100 bashrcs ;)
this is rev 3296 This has been released in 2.1_rc1. |