Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 427920

Summary: app-portage/gentoolkit: epkinfo should have an option to show plain output for piping to a file
Product: Portage Development Reporter: Pacho Ramos <pacho>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: CONFIRMED ---    
Severity: enhancement CC: floppym
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Pacho Ramos gentoo-dev 2012-07-24 17:52:41 UTC
I was trying to get:
epkginfo -Hm $(cat LISTA.txt|cut -d " " -f1)

output into a file but I couldn't because of it's formatting, would be nice to be able to get that output in a plain format for piping it to a file

Thanks a lot

Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2012-07-24 18:00:00 UTC
When output is a pipe, equery meta (epkginfo) operates in quiet mode. Does that not work for you?

floppym@naomi ~ % epkginfo -Hm www-client/chromium sys-boot/grub | cat
chromium
base-system
floppym@gentoo.org
Comment 2 Pacho Ramos gentoo-dev 2012-07-24 18:20:18 UTC
(In reply to comment #1)
> When output is a pipe, equery meta (epkginfo) operates in quiet mode. Does
> that not work for you?
> 
> floppym@naomi ~ % epkginfo -Hm www-client/chromium sys-boot/grub | cat
> chromium
> base-system
> floppym@gentoo.org

That output can be really ugly for some packages, try:

epkginfo -Hm app-accessibility/java-access-bridge app-admin/system-config-printer-common|cat
gnome-accessibility
java
kde
gnome
reavertm@gentoo.org
Comment 3 Mike Gilbert gentoo-dev 2012-07-24 18:29:56 UTC
If you want to see the package name associated with each herd/maintainer, you could use a loop:

for pkg in $(cat LISTA.txt|cut -d " " -f1); do
  printf "$pkg: %s\n" $(epkginfo -Hm $pkg)
done

Some additional output formatting options would be nice though.
Comment 4 Pacho Ramos gentoo-dev 2012-07-24 18:49:05 UTC
Nice, thanks a lot for the hint!
Comment 5 Paul Varner (RETIRED) gentoo-dev 2012-07-24 18:56:16 UTC
Currently, the only other option for formatting is to call equery meta with the --no-pipe option and/or use grep

equery --no-pipe meta -Hm app-accessibility/java-access-bridge app-admin/system-config-printer-common | cat
 * app-accessibility/java-access-bridge [gentoo]                                                                                           
gnome-accessibility (gnome-accessibility@gentoo.org)                                                                                       
java (java@gentoo.org)                                                                                                                     
None specified                                                                                                                             
                                                                                                                                           
 * app-admin/system-config-printer-common [gentoo]                                                                                         
kde (kde@gentoo.org)                                                                                                                       
gnome (gnome@gentoo.org)                                                                                                                   
reavertm@gentoo.org (Maciej Mrozowski)

                                                                                                    
equery --no-pipe meta app-accessibility/java-access-bridge app-admin/system-config-printer-common | egrep '(\*|Herd:|Maintainer:)'
 * app-accessibility/java-access-bridge [gentoo]
Herd:        gnome-accessibility (gnome-accessibility@gentoo.org)
Herd:        java (java@gentoo.org)
Maintainer:  None specified
 * app-admin/system-config-printer-common [gentoo]
Herd:        kde (kde@gentoo.org)
Herd:        gnome (gnome@gentoo.org)
Maintainer:  reavertm@gentoo.org (Maciej Mrozowski)