the new discussion can be found here: http://forums.gentoo.org/viewtopic.php?t=278819
Portagedb is a small program for searching the portage tree. Similar to app-portage/esearch it uses an index file (/var/cache/portagedb) which makes it very fast.
Usage:
Code: Select all
xoa@pluto ~ $ portagedb
Usage: portagedb [options] command <search string>
Commands: u(pdate) Updates the database -> /var/cache/portagedb
s(earch) Search for ebuilds (posix regex)
S(earchdesc) Search for ebuilds + descriptions (posix regex)
Options: -n,--nocolor Do not use ANSI color codes
-c,--compact Compact search results
-v,--verbose Verbose search resultsCode: Select all
pluto ~ # pdb s bogo
* app-text/bogosort
Available versions: ~0.4.2
Installed: no
Homepage: http://www.lysator.liu.se/~qha/bogosort/
Description: A file sorting program which uses the bogosort algorithm
* mail-filter/bogofilter
Available versions: 0.92.8 [M]~0.93.2
Installed: no
Homepage: http://bogofilter.sourceforge.net/
Description: Bayesian spam filter designed with fast algorithms, and tuned for speed.Project page: http://portdb.sourceforge.net
Installation: emerge portagedb
(Latest version with overlay support: http://prdownloads.sourceforge.net/port ... 2?download)
A little benchmark:
#!/bin/bash
MEMSIZE=512
flushcache() { dd if=/dev/hda of=/dev/null ibs=1048576 count=$[ MEMSIZE*2 ] 2>/dev/null; }
gettime_real( ) {
echo -n "flushcache; "
flushcache
echo -e -n $1 "\r\t\t\t\t\t"
(time $1 >/dev/null) 2>&1 |egrep real |egrep "[[:digit:]]*m.*s" -o
}
gettime_real "portagedb u"
gettime_real "eupdatedb"
gettime_real "portagedb S rare"
gettime_real "esearch -S rare"
gettime_real "emerge --searchdesc rare"
Updates:
Code: Select all
-------------------------------------------------------------------------------
Changelog for portagedb
-------------------------------------------------------------------------------
Project page: http://portdb.sf.net
Discussion: http://forums.gentoo.org/viewtopic.php?t=214547&highlight=portagedb
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Ideas for future versions:
-------------------------------------------------------------------------------
- Support slotted versions, bug #1025517
https://sourceforge.net/tracker/index.php?func=detail&aid=1025517&group_id=117574&atid=678491
- Provide a way to automatically "portagedb u" after emerge
- Tests on other platforms than x86
- Option for arbitrary formatting
- Replicate esearch's esync.py
- Option '-i' for restricting search results to installed packages
- Improve error handling
-------------------------------------------------------------------------------
v0.2.1_alpha1:
-------------------------------------------------------------------------------
* Execution speed of "portagedb s" is back to normal again,
i.e. no unnecessary ~1 sec delay when the program is started.
* Portage overlays now are supported!
-------------------------------------------------------------------------------
v0.2.0:
-------------------------------------------------------------------------------
- nothing changed. alpha4 appears to be stable on x86 and amd64.
we're in the portage tree now :)
-------------------------------------------------------------------------------
v0.2.0_alpha4:
-------------------------------------------------------------------------------
- xororand * Fixed memory management issues which lead to a crash on amd64
(Discovered valgrind and removed all delete/delete[]/free() mismatches)
-------------------------------------------------------------------------------
v0.2.0_alpha3:
-------------------------------------------------------------------------------
- LinuxCommando * Fixed bug: "portagedb s" now throws an error message
- LinuxCommando * Added: "portagedb u" checks for root rights
- LinuxCommando * Added:
"portagedb s abc xyz" searches for all packages with either abc or xyz in their name
equivalent to: portagedb s "\(abc\)\|\(xyz\)"
- xororand * Fixed: /etc/portage/package.unmask is now used
-------------------------------------------------------------------------------
v0.2.0_alpha2:
-------------------------------------------------------------------------------
* Fixed bug #1025515: Version numbers now are sorted properly
https://sourceforge.net/tracker/index.php?func=detail&aid=1025515&group_id=117574&atid=678491
Reference: http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=1#doc_chap2
* Fixed bug #1025519: Ebuild is available
https://sourceforge.net/tracker/index.php?func=detail&aid=1025519&group_id=117574&atid=678491
* Stability and masking of packages are distinguished:
Masked: Red / [M]
Stable: Green / No prefix
Unstable: Brown / ~
* Different levels of verbosity:
-c Compact: One line per result
-v Verbose: Print licenses
* Color of packages changed from light green to normal green
-> looks better in black-on-white terminals
* The arch is currently determined by a call to "portageq envvar ARCH" which is kinda
slow, taking about 1 second on my system. If someone knows a faster, _reliable_ way,
please tell me.
------------------------------------------------------------------------------
v0.1.3-r1:
------------------------------------------------------------------------------
* Fixed bug #1048527: 'portagedb s' searches in package names AND descriptions
https://sourceforge.net/tracker/index.php?func=detail&aid=1048527&group_id=117574&atid=678491
-------------------------------------------------------------------------------
v0.1.3:
-------------------------------------------------------------------------------
* PORTDIR in /etc/make.conf is checked
* Colored text only uses foreground color so it looks nice on
Black-On-White terminals
* Added new option "--nocolor"
-------------------------------------------------------------------------------
v0.1.2:
-------------------------------------------------------------------------------
* fixed a stupid bug with directory handling. thank you wiebel for debugging.




