Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 112045 - equery: request --very-silent and --strip-version options
Summary: equery: request --very-silent and --strip-version options
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2005-11-09 22:47 UTC by Sven Jacobs
Modified: 2010-04-08 15:23 UTC (History)
1 user (show)

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 Sven Jacobs 2005-11-09 22:47:33 UTC
The equery tool should be enhanced by two new options:

--very-silent: does not output any text besides the package names in list mode.
--strip-version: local option for list mode; strips any version information from
the package name (sys-kernel/gentoo-sources-2.6.13-r5 becomes
sys-kernel/gentoo-sources)

this way with --very-silent and --strip-version combined one could use the
output from equery l to pipe it to other commands, e.g 

equery --very-silent l --strip-version | xargs emerge -u

Reproducible: Always
Steps to Reproduce:
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2005-11-10 01:53:19 UTC
Check qlist --installed --nocolor
You can get qlist by emerging portage-utils.

equery --very-silent l --strip-version | xargs emerge -u
Well this is probably just a bad example but this particular case would be
achieved by just emerge -uD
Comment 2 Sven Jacobs 2005-11-10 02:31:36 UTC
Are you sure? AFAIK emerge -uD does only take packages from the world file into
account whereas equery l lists every package.

At least the good old "qpkg -I -nc | xargs emerge -uD" did find more packages to
update than emerge -uD world, that I'm sure!
Comment 3 Petteri Räty (RETIRED) gentoo-dev 2005-11-10 03:13:01 UTC
(In reply to comment #2)
> Are you sure? AFAIK emerge -uD does only take packages from the world file into
> account whereas equery l lists every package.
> 

Didn't think about that. You could be right.
Comment 4 Neil 2008-09-24 16:01:51 UTC
(In reply to comment #0)
> The equery tool should be enhanced by two new options:
> 
> --very-silent: does not output any text besides the package names in list mode.
> --strip-version: local option for list mode; strips any version information from
> the package name (sys-kernel/gentoo-sources-2.6.13-r5 becomes
> sys-kernel/gentoo-sources)
> 

I think the --strip-version option would be very useful to have in equery.

I've encountered a corrupt /var/lib/portage/world file and neither of the options given in the FAQ work http://forums.gentoo.org/viewtopic-t-136627.html and its a bit of a pain in the proverbial to strip out the versions (although it is improving my knowledge and understanding of regex's ;-).
Comment 5 Douglas Anderson 2010-03-06 12:26:41 UTC
$ equery --quiet list gcc
sys-devel/gcc-4.3.4:4.3
$ equery --quiet list gcc --format '$cp'
sys-devel/gcc

Passing --quiet to equery has made it quite quiet in all the 0.3.0_rcs. The new --format option available on list and hasuse is as yet undocumented[1] but very powerful and lets you get just about any piece of info you could want and also combine them.
$ equery --quiet list gcc --format '$cp-$fullversion ($slot)'
sys-devel/gcc-4.3.4 (4.3)

It will be released in the next rc.
[1] bug #307949
Comment 6 Paul Varner (RETIRED) gentoo-dev 2010-04-08 15:23:59 UTC
This is fixed in gentoolkit-0.3.0_rc10 with the --format option added in bug 307949.  However the --format option is still undocumented.

For the example listed the following command does what you want:
equery -q list '*' --format '$cp' | xargs emerge -pu