Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Simple script to list packages with description
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
hpaluch1
n00b
n00b


Joined: 05 Mar 2005
Posts: 4

PostPosted: Sat Mar 05, 2005 7:10 pm    Post subject: Simple script to list packages with description Reply with quote

Hi folks!
Recently I have an idea to create simple list of all portages in /usr/portage along with one line description, but didn't find command to do this. So after little analysis of /usr/bin/emerge I had written this tiny python script:

Code:

#
# portage_list.py
# show 1line descriptions of all portage packages
# Note: you must be in portage group (or root)!

import portage

for x in  portage.db["/"]["porttree"].getallnodes():
   e_build = portage.portdb.xmatch("bestmatch-visible",x)
   descr = "*** None"
   if len(e_build) > 0:  # sometimes no unmasked ebuild available!
      descr =  portage.portdb.aux_get(e_build,["DESCRIPTION"])[0]
   print "%-20s - %s" % ( x, descr )



It will produce output like this:
Code:

app-accessibility/gok - Gnome Onscreen Keyboard
app-accessibility/epos - language independent text-to-speech system
app-accessibility/yasr - general-purpose console screen reader
app-accessibility/gnome-mag - Gnome magnification service definition
app-accessibility/flite - Flite text to speech engine
app-accessibility/festival-gaim - A plugin for gaim which enables text-to-speech
...


That simple old plain text list can be handy for browsing with less, etc. Maybe someone find it useful ;-)

Best regards
_________________
--Henryk Paluch
Back to top
View user's profile Send private message
G2k
l33t
l33t


Joined: 06 Mar 2004
Posts: 672
Location: Rome, Italy

PostPosted: Thu Dec 29, 2005 3:09 pm    Post subject: Reply with quote

nice idea this should be included in portage's -v option.
_________________
Animula vagula blandula,
Hospes comesque corporis,
Quae nunc abibis in loca
Pallidula rigida nudula,
Nec ut soles dabis iocos...
- Imp. Caesar Hadrianus
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 18084

PostPosted: Thu Dec 29, 2005 8:34 pm    Post subject: Reply with quote

See also app-portage/esearch
_________________
Those who know what's best for us must rise and save us from ourselves.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum