esearch, search the portage database using an index file

   Home    Programmieren    Projekte    esearch    Musik    Linux    Links    About   
   deutsch    manpage   
 
          

esearch

1. Description

esearch is a small script for the linux distribution Gentoo. It behaves exactly like emerge -s resp. emerge -S. The advantage of esearch over emerge is the search index it uses.

shark (~) $ time emerge -s mozilla > /dev/null

real    0m11.740s
user    0m1.400s
sys     0m0.140s

shark (~) $ time esearch mozilla > /dev/null

real    0m0.108s
user    0m0.095s
sys     0m0.010s

The disadvantage is then of course, that you have to create this index (eupdatedb) which takes some time.

2. News

  • 26 Sep 2004
    version 0.7 brings a lot of new features!
    • Added a -v/--verbose option to esearch, which shows some additional information about a package. Used some code from Carlos Silva, who wrote a patch for emerge (#11739). Thanks!
    • Added a patch from Thomas Buntrock, which adds a -s/--nospinner option to esync. (Fixes #57030).
    • Sandro Bonazzola translated the manpages for all the italian users, thanks a lot.
    • Fixed bug #58399. Sometimes python doesn't compile the eupdatedb index for any reasons.
    • Added patch from Fernando Altomare Serboncini, which changes the behaviour of esearch -c: Now it prints the category also.
    • Added patch from Steve Acheson, which adds an -I/--instonly option to esearch. If it is enabled, only packages which are installed will be found.
    Thanks to all the people who help esearch to get better!
  • 25 Jul 2004
    version 0.6.3:
    • Manpages for esync and eupdatedb.
    • The License field will be indexed from now on.
    • Fixed a bug caused by a new version of python, resulting in "bad digest" messages. Thanks to the guys from the italian forums.
    • Sort the ebuilds in the esearch -e view by version.
  • 02 Jul 2004
    version 0.6.2:
    • Patch from Tavis Ormandy which fixes a security hole in the temp file handling.
    • Patch from Roman Kreisel, which adds a -v/--verbose option to esync. With -v enabled esync shows the output from emerge sync.
  • 10 May 2004
    version 0.6.1:
    • Support for emerge-webrsync!
    • esync is using xterm titles to show current action.
    • -n/--nocolor option for esync to suppress color codes.
    • Lots of bugfixes, thanks to all the people who send me bugreports and mails with feature requests!
  • 06 Feb 2004
    version 0.6:
    • When using esearch -e ^package$` esearch now shows the available version as default ebuild, so you just have to press enter.
    • New --directory/-d option for esearch/eupdatedb, to use an other directory for storing the index file.
    • A lot of updates and fixes, see ChangeLog
  • 11 Jan 2004
    version 0.5.3:
    • Patch from Lars Gustäbel which speeds up the esearch output method for large datasets a lot.
    • New script included, called esync, which does emerge sync followed by an eupdatedb and then shows the updates during the sync.
    • Some fixes, see ChangeLog for details
  • 20 Oct 2003
    version 0.5.2, new functions:
    • a new option (--own=pattern, -o pattern) has been added to print the output in a user-defined format, for details see manpage.
    • multiple search params are possible, e.g. esearch ^xmms$ ^mozilla$
    • a new option for eupdatedb --quiet/-q to show only the summary, fixes bug #32853.
  • 23 Oct 2003
    version 0.5.1, 2 bugs are now fixed and esearch now has a manpage, esearch(1).
  • 19 Oct 2003
    version 0.5, getopt-support for eupdatedb (--help/--verbose/--nocolor), --ebuild option for esearch to view the ebuilds of found packages, bugfixes.
  • 02 Oct 2003
    version 0.4.2, a few bugfixes.
  • 30 Sep 2003
    version 0.4.1, see ChangeLog.
  • 19 Sep 2003
    esearch has been added to the official portage tree! (app-portage/esearch)
  • 18 Sep 2003
    version 0.4, from now on eupdatedb writes the index directly into the file to improve speed.
  • 17 Sep 2003
    version 0.3.1, see ChangeLog

3. Example

Output is exactly the same:

root (~) # eupdatedb
 * indexing: 0 ebuilds to go
 * esearch-index generated in 3 minutes and 25 seconds
 * indexed 5515 ebuilds
 * size of esearch-index: 843 kB

shark (~) $ esearch vim$
[ Results for search key : vim$ ]
[ Applications found : 3 ]

*  app-editors/vim
      Latest version available: 6.3-r1
      Latest version installed: 6.3-r1
      Size of downloaded files: 4,680 kB
      Homepage:    http://www.vim.org/
      Description: Vim, an improved vi-style text editor
      License:     vim

*  app-editors/gvim
      Latest version available: 6.3-r1
      Latest version installed: [ Not Installed ]
      Size of downloaded files: 4,680 kB
      Homepage:    http://www.vim.org/
      Description: GUI version of the Vim text editor
      License:     vim

*  app-editors/kvim [ Masked ]
      Latest version available: 6.2.14
      Latest version installed: 6.2.14
      Size of downloaded files: 4,896 kB
      Homepage:    http://www.freehackers.org/kvim
      Description: KDE editor based on vim
      License:     GPL-2



esearch has an extra option, --compact (short: -c), which will compress the output to a few lines:

shark (~) $ esearch -c vim$
[ I] app-editors/vim (6.3-r1):  Vim, an improved vi-style text editor
[ N] app-editors/gvim (6.3-r1):  GUI version of the Vim text editor
[MI] app-editors/kvim (6.2.14):  KDE editor based on vim

4. Usage

To install esearch just emerge it:

emerge esearch

After that you'll have to execute eupdatedb to generate the searchindex. Now you're ready to use esearch:

esearch (0.7) - Replacement for 'emerge search' with search-index

Usage: esearch [ options ] pattern
Options:
  --searchdesc, -S
    Search package descriptions as well

  --fullname, -F
    Search packages full name (includes category)

  --instonly, -I
    Find only packages which are installed

  --compact, -c
    More compact output format

  --verbose, -v
    Give a lot of additional information (slow!)

  --ebuild, -e
    View ebuilds of found packages

  --own=format, -o format
    Use your own output format, see manpage for details of format

  --directory=dir, -d dir
    Use dir as directory to load esearch index from

  --nocolor, -n
    Don't use ANSI codes for colored output

5. ChangeLog

*esearch-0.7 (26 Sep 2004)

  26 Sep 2004; David Peter  esearch.py:
  Added patch from Steve Acheson , which
  adds an -I/--instonly option to esearch. If it is enabled,
  only packages which are installed will be found.

  26 Sep 2004; David Peter  esearch.py:
  Added patch from Fernando Altomare Serboncini ,
  which changes the behaviour of 'esearch -c': Now it
  prints the category also.

  15 Sep 2004; David Peter  eupdatedb.py:
  Fixed bug #58399. Sometimes python doesn't compile the eupdatedb
  index for any reasons.

  15 Sep 2004; David Peter  it/esearch.1,
  it/eupdatedb.1, it/esync.1:
  Added the italian manpages created by Sandro Bonazzola
  , thanks a lot.

  15 Sep 2004; David Peter  esync.py:
  Added a patch from Thomas Buntrock
  , which adds
  a -s/--nospinner option to esync. (Fixes #57030)

  17 Aug 2004; David Peter  esearch.py:
  Added a -v/--verbose option to esearch, which shows some
  additional information about a package. Used some code
  from Carlos Silva , who wrote
  a patch for emerge (#11739). Thanks!

  17 Aug 2004; David Peter  esearch.py,
  eupdatedb.py, esync.py:
  Various small code cleanups.

*esearch-0.6.3 (25 Jul 2004)

  08 Jul 2004; David Peter  esync.py:
  Sort the ebuilds by version (using portage.pkgcmp).

  08 Jul 2004; David Peter  esearch.1,
  eupdatedb.1, esync.1:
  Added manpages for eupdatedb and esync and updated the one
  for esearch.

  08 Jul 2004; David Peter  eupdatedb.py,
  esearch.py, esync.py:
  Added a 'dbversion' to the esearch index, to be sure it is
  not outdated.

  06 Jul 2004; David Peter  eupdatedb.py,
  esearch.py:
  Added the "License" field to the index and the output of
  esearch.

  06 Jul 2004; David Peter  eupdatedb.py:
  Updated file handling, so there are no "bad digests"
  anymore. Thanks to Danilo, and the other guys from
  the italian forums.

*esearch-0.6.2 (30 Jun 2004)

  30 Jun 2004; David Peter  eupdatedb.py:
  Patch from Tavis Ormandy  which fixes
  a security hole in the temp file handling.

  16 May 2004; David Peter  esync.py:
  Patch from Roman Kreisel , which
  adds a -v/--verbose option to esync. With -v enabled
  esync shows the output from 'emerge sync'.

*esearch-0.6.1 (10 May 2004)

  10 May 2004; David Peter  esync.py:
  Showing current action in xterm title.

  02 May 2004; David Peter  esync.py:
  Added message, in case there are no updates.

  03 Apr 2004; David Peter  esync.py:
  Sort updated packages in output.

  28 Mar 2004; David Peter  esync.py:
  Support for emerge-webrsync (--webrsync/-w).

  28 Mar 2004; David Peter  esync.py:
  Added getopt including --help/-h, --nocolor/-n. Now also checking
  if eupdatedb was successful.

  15 Feb 2004; David Peter  esync.py:
  use `/usr/sbin/eupdatedb` instead of `eupdatedb`, this
  fixes #41554.

  08 Feb 2004; David Peter  esearch.py:
  corrected typo (fixes #40832).

*esearch-0.6 (06 Feb 2004)

  04 Feb 2004; David Peter  esync.py:
  Small bugfix in esync: test if esearchdb exists.

  25 Jan 2004; David Peter  esearch.py,
  eupdatedb.py, esync.py:
  Added descriptions on the beginning to all three files.

  25 Jan 2004; David Peter  eupdatedb.py:
  Added a warning, if ACCEPT_KEYWORDS is set in environment,
  because this will result in a modified index file.

  25 Jan 2004; David Peter  eupdatedb.py:
  Test on startup, if there is already another eupdatedb process
  running, thanks to Marius Mauch .

  25 Jan 2004; David Peter  esync.py:
  Fixed traceback in esync, in case /tmp/esync(old|new)tree.pyc
  already existed. (Fixes #39629)

  22 Jan 2004; David Peter  esearch.py, eupdatedb.py:
  New -d/--directory option for both, esearch and eupdatedb, to store the
  esearch index in an other directory than /var/cache/edb/.

  22 Jan 2004; David Peter  esearch.py:
  When using `esearch -e ^package$`, esearch now shows the
  available version as default ebuild, so you just have to
  press enter.

  22 Jan 2004; David Peter  esearch.py:
  KeyboardInterrupt handling for `esearch -e`.

*esearch-0.5.3 (11 Jan 2004)

  11 Jan 2004; David Peter  eupdatedb.py:
  Added KeyboardInterrupt handling.

  11 Jan 2004; David Peter  esearch.py, eupdatedb.py:
  sys.path work-around for portage python modules.

  11 Jan 2004; David Peter  esync.py:
  Added esync, a script which does `emerge sync` followed by
  a `eupdatedb` and then shows the updates during the sync.

  13 Dec 2003; David Peter  esearch.py:
  Added a patch from Lars Gustäbel  which speeds
  up the esearch output method for large datasets a lot.

  11 Dec 2003; David Peter  esearch.py:
  Changed colors in compact mode a bit to fit the behaviour
  of emerge: update [U] and version are now in turquoise.

*esearch-0.5.2 (20 Oct 2003)

  14 Nov 2003; David Peter  esearch.py:
  Added --own=format/-o format to use a user-defined output
  format. See manpage for details and examples.

  13 Nov 2003; David Peter  eupdatedb.py:
  Added --quiet/-q mode to show only the summary of the eupdatedb
  output. fixes bug #32853 (http://bugs.gentoo.org/show_bug.cgi?id=32853).

  13 Nov 2003; David Peter  esearch.py:
  Added support for multiple search patterns.

*esearch-0.5.1 (23 Oct 2003)

  21 Oct 2003; David Peter  esearch.1:
  Added manpage esearch.1 to esearch.

  21 Oct 2003; David Peter  eupdatedb.py:
  Fixed small countdown bug, eupdatedb wasn't counting to zero
  because of invalid ebuilds.

  20 Oct 2003; David Peter  esearch.py:
  Fixed bug, ebuilds are now sorted properly.

*esearch-0.5 (19 Oct 2003)

  19 Oct 2003; David Peter  eupdatedb.py:
  Added getopt support. --nocolor/-n and --verbose/-v to show categories
  while updating index.

  18 Oct 2003; David Peter  esearch.py:
  Added --ebuild/-e option to view ebuilds of found packages. Inspired
  by http://forums.gentoo.org/viewtopic.php?t=93334.

  18 Oct 2003; David Peter  esearch.py, eupdatedb.py:
  Changed header, so it should work with every python version.

*esearch-0.4.2 (02 Oct 2003)

  02 Oct 2003; David Peter  eupdatedb.py:
  replaced the counter (0 to 100 percent) by an ebuild-countdown,
  because the display was often wrong.

  02 Oct 2003; David Peter  eupdatedb.py:
  fixed bug #30171 (http://bugs.gentoo.org/show_bug.cgi?id=30171)

*esearch-0.4.1 (30 Sep 2003)

  29 Sep 2003; David Peter  eupdatedb.py:
  write data into tempfile first, so esearch can be used while updating
  esearchdb

  29 Sep 2003; David Peter  esearch.py:
  Added getopt support

  29 Sep 2003; David Peter  eupdatedb.py:
  Fixed small bug, eupdatedb sometimes showed 101% while indexing ebuilds

  28 Sep 2003; David Peter  esearch.py:
  Added patch from Eldad Zack  to allow searching for
  full names (e.g. app-portage/esearch)

*esearch-0.4 (18 Sep 2003)

  18 Sep 2003; David Peter  eupdatedb.py:
  no longer writing into memory, but directly into file => speedup

  18 Sep 2003; David Peter  esearch.py:
  added colored help-message

*esearch-0.3.1 (17 Sep 2003)

  17 Sep 2003; David Peter  esearch.py:
  added feature which fixes wrong regexps (e.g. mysql++ -> mysql)

6. Download

Some older versions:

Download esearch-0.7.tar.bz2 (9.99 kB)
Download esearch-0.6.3.tar.bz2 (7.95 kB)
Download esearch-0.6.2.tar.bz2 (7.27 kB)
Download esearch-0.6.1.tar.bz2 (7.02 kB)
Download esearch-0.6.tar.bz2 (6.58 kB)
Download esearch-0.5.3.tar.bz2 (5.72 kB)
Download esearch-0.5.2.tar.bz2 (4.96 kB)
Download esearch-0.5.1.tar.bz2 (4.13 kB)
Download esearch-0.5.tar.bz2 (3.71 kB)
Download esearch-0.4.2.tar.bz2 (3.32 kB)
Download esearch-0.4.1.tar.bz2 (2.8 kB)
Download esearch-0.4.tar.bz2 (2.46 kB)
Download esearch-0.3.1.tar.bz2 (2.1 kB)
Download esearch-0.3.0.tar.bz2 (2.04 kB)
Download esearch-0.2.2.tar.bz2 (1.75 kB)
Download esearch-0.2.1.tar.bz2 (1.61 kB)

7. Bugreports

Please report bugs via bugs.gentoo.org or send a mail.


© 2004 by David Peter