Search:  
Gentoo Wiki

TIP_Speed_up_searches_in_portage

This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Contents

Introduction

This "speed up" is intended for those that search for packages and want to do it faster! These two packages make searches for ebuilds take about 1-2 seconds on a modest machine (Athlon 1.4Ghz)

Possibility Nr. 1: Esearch

simply type

emerge esearch

to get it. The first time you use esearch, you will be offered instructions on building the database.

How to use

Use 'esearch foo' in place of 'emerge -s foo'. Use 'esearch -S foo' in place of 'emerge -S foo'.

Add 'eupdatedb' to your crontab in addition to 'emerge sync'. Run 'eupdatedb' as often as you run 'emerge sync'. As an alternative you can use the 'esync'-script, which is included in the esearch-ebuild. This script will do an 'emerge sync' and an 'eupdatedb' and after those finish it will list all new and updated ebuilds.

Running (for example) "esearch openoffice" produces output like this:

*  app-office/openoffice-ximian
      Latest version available: 1.3.9-r1
      Latest version installed: [ Not Installed ]
      Size of downloaded files: 221,660 kB
      Homepage:    http://go-oo.org
      Description: Ximian-ized version of OpenOffice.org, a full office productivity suite.
      License:     || ( LGPL-2 SISSL-1.1 )

If you use the 'esync' script to update portage, it has a nice output of the packages that were updated similar to the following:

[MN] x11-apps/setxkbmap (0.99.1):  X.Org setxkbmap application
[MN] x11-apps/showfont (0.99.1):  X.Org showfont application
[MN] x11-apps/smproxy (0.99.1):  X.Org smproxy application
[ N] net-proxy/squid (2.5.11):  A caching web proxy, with advanced features
[MN] net-im/tmsnc (0.3.0):  TMSNC is a textbased MSN client written in C.
[MN] x11-proto/trapproto (3.4.1):  X.Org Trap protocol headers
[MN] x11-wm/twm (0.99.1):  X.Org twm application
[ U] sys-fs/udev (070-r1):  Linux dynamic and persistent device naming support (aka userspace devfs)
[MN] x11-misc/util-macros (0.99.1):  X.Org autotools utility macros
[MN] x11-proto/videoproto (2.2.1):  X.Org Video protocol headers
[MN] x11-apps/viewres (0.99.1):  X.Org viewres application
[MN] x11-apps/x11perf (0.99.1):  X.Org x11perf application

Possibility Nr. 2: EiX

Eix stands for EbuildIndeX and is even faster than esearch.

simply type

emerge eix

to get it. You can then run 'update-eix' to build your eix database.

How to Use

Use 'eix foo' in place of 'emerge -s foo' Use 'eix -S foo' in place of 'emerge -S foo'

Everytime you do 'emerge sync', you should also run 'update-eix' (or 'eix -u' for older versions) to update its database, which takes much much less time than eupdatedb in esearch. As an alternative you can run 'eix-sync' which runs emerge --sync and update-eix, it then compares the new cache with the old cache using diff-eix. (Note that you must perform 'update-eix' at least once before running 'eix-sync'. The latter will not build the index from scratch.)

Running (for example) "eix kdesktop" produces output like that of esearch:

* kde-base/kdesktop 
     Available versions:  3.4.1 3.4.2 3.4.3 ~3.5.0 [M]3.5.1
     Installed:           3.4.3
     Homepage:            http://www.kde.org/
     Description:         The KDE desktop

You can see which versions of a package exist, which are stable, and which are masked.

You can use the -c option to get a shorter output, -I to search only the installed packages and -C to look up a single category.

Retrieved from "http://www.gentoo-wiki.info/TIP_Speed_up_searches_in_portage"

Last modified: Wed, 26 Dec 2007 15:47:00 +0000 Hits: 35,249