Gentoo is a unique distribution, and presents some complexities that simply
don't exist for other distributions. As Gentoo developers and contributors
discovered some of these complexities, they also wrote tools to help users and
administrators work around them. Many of these tools have been contributed to
the Gentoo project, and are included in the package
Gentoolkit contains a whole bunch of useful tools to help manage Portage and the ebuild architecture. Most users -- particularly those who update systems often -- will benefit from having gentoolkit installed.
Just as with any Gentoo package, installation is just a simple emerge.
# emerge gentoolkit
At the time of this writing, not all of the programs in gentoolkit are well
documented. Some have man pages, but not all. Any documentation that a program
might have (other than man pages) is stored in
Calling
One of the most common uses for
# qpkg -i net-misc/neon
net-misc/neon-0.15.3-r1
HTTP and WebDAV client library [ http://www.webdav.org/neon ]
net-misc/neon-0.18.5
HTTP and WebDAV client library [ http://www.webdav.org/neon ]
net-misc/neon-0.19.2
HTTP and WebDAV client library [ http://www.webdav.org/neon ]
net-misc/neon-0.19.2-r1
HTTP and WebDAV client library [ http://www.webdav.org/neon ]
net-misc/neon-0.21.1
HTTP and WebDAV client library [ http://www.webdav.org/neon ]
# qpkg -l app-portage/gentoolkit app-portage/gentoolkit-0.1.14-r1 * CONTENTS: /usr /usr/share /usr/share/gentoolkit /usr/share/gentoolkit/histogram.awk /usr/share/doc /usr/share/doc/gentoolkit-0.1.14-r1 /usr/share/doc/gentoolkit-0.1.14-r1/gentool /usr/share/doc/gentoolkit-0.1.14-r1/gentool/ChangeLog.gz /usr/share/doc/gentoolkit-0.1.14-r1/lintool /usr/share/doc/gentoolkit-0.1.14-r1/lintool/checklist-for-ebuilds.gz /usr/share/doc/gentoolkit-0.1.14-r1/lintool/ChangeLog.gz /usr/share/doc/gentoolkit-0.1.14-r1/etc-update /usr/share/doc/gentoolkit-0.1.14-r1/etc-update/ChangeLog.gz /usr/share/man /usr/share/man/man1 /usr/share/man/man1/qpkg.1.gz /usr/share/man/man1/lintool.1.gz /usr/share/man/man1/etc-update.1.gz /usr/bin /usr/bin/gentool-bump-revision /usr/bin/gentool-total-coverage /usr/bin/gentool-author-coverage /usr/bin/gentool-package-count /usr/bin/qpkg /usr/bin/pkg-size /usr/bin/lintool /usr/sbin /usr/sbin/pkg-clean /usr/sbin/mkebuild /usr/sbin/emerge-webrsync /usr/sbin/epm /usr/sbin/etc-update /etc /etc/etc-update.conf
To find the package that a file came from, use the
# qpkg -f /usr/lib/mozilla net-www/mozilla *
Sometimes multiple versions of the same package may exist.
# qpkg --dups --slot app-portage/gentoolkit kde-base/kdeaddons kde-base/kdeadmin kde-base/kdeartwork kde-base/kdebase kde-base/kdegames kde-base/kdelibs kde-base/kdemultimedia kde-base/kdenetwork kde-base/kdetoys kde-base/kdeutils media-libs/freetype x11-libs/qt
Sometimes it is useful to check a package's integrity to know that files have
not been replaced since they were installed.
To check both mtimes and md5 sums, use the
# qpkg gnupg -c -v app-crypt/gnupg-1.0.6 * /usr/lib/gnupg/rndunix !md5! !mtime! /usr/lib/gnupg/rndegd !md5! !mtime! /usr/lib/gnupg/tiger !md5! !mtime! /usr/bin/gpg !md5! !mtime! /usr/bin/gpgv !md5! !mtime! /usr/share/gnupg/options.skel !md5! !mtime! /usr/share/gnupg/FAQ !md5! !mtime! /usr/share/gnupg/faq.html !md5! !mtime! /usr/share/locale/da/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/de/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/eo/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/et/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/fr/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/id/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/it/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/ja/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/nl/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/pl/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/pt_BR/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/sv/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/locale/tr/LC_MESSAGES/gnupg.mo !md5! !mtime! /usr/share/info/gpgv.info.gz !md5! !mtime! /usr/share/man/man1/gpg.1.gz !md5! !mtime! /usr/share/man/man1/gpgv.1.gz !md5! !mtime! 24/92 app-crypt/gnupg-1.0.7 * 0/101
As you can see, I have more than one version of GnuPG installed.
Running
# lintool app-crypt/gnupg/gnupg-1.0.7.ebuild
app-crypt/gnupg/gnupg-1.0.7.ebuild : Not OK
-------------------------------------------------------------------------------
Summary for all 1 ebuild(s) checked # errors/warns
-------------------------------------------------------------------------------
Testing for illegal space characters, weird backslash formatting : 0 / 0
Testing for malformed headers : 0 / 1
Testing for occurence of deprecated try : 0 / 0
Testing for superfluous A=${P}.tar.gz : 0 / 0
Testing for empty DEPEND : 0 / 0
Testing for empty HOMEPAGE : 0 / 0
Testing for empty DESCRIPTION : 0 / 0
Testing for presence of env vars : 1 / 1
Testing for sane USE flag usage : 0 / 0
Total number of ebuilds with errors : 1 (100%)
Total number of ebuilds with warnings : 1 (100%)
The first line summarizes whether the ebuild is okay or not. In the case of
Looking at the ebuild, I see that it is missing a couple of required
env vars (LICENSE and RDEPEND). Adding those fixes the error. But there are
still two warnings -- one for malformed headers and one for env vars. To help
me find those, I can run
# lintool --show-details ./gnupg-1.0.7.ebuild
-------------------------------------------------------------------------------
# Some data cut for brevity....
Status for ./gnupg-1.0.7.ebuild
* Testing for malformed headers : passed
- (W) Has illegal or suspect headers:
|Suspect copyright year: # Copyright 1999-2000 Gentoo Technologies, Inc.
* Testing for occurence of deprecated try : passed
* Testing for superfluous A=${P}.tar.gz : passed
* Testing for empty DEPEND : passed
* Testing for empty HOMEPAGE : passed
* Testing for empty DESCRIPTION : passed
* Testing for presence of env vars : passed
- (W) Missing SLOT=
* Testing for sane USE flag usage : passed
-------------------------------------------------------------------------------
Summary for all 1 ebuild(s) checked # errors/warns
-------------------------------------------------------------------------------
Testing for illegal space characters, weird backslash formatting : 0 / 0
Testing for malformed headers : 0 / 1
Testing for occurence of deprecated try : 0 / 0
Testing for superfluous A=${P}.tar.gz : 0 / 0
Testing for empty DEPEND : 0 / 0
Testing for empty HOMEPAGE : 0 / 0
Testing for empty DESCRIPTION : 0 / 0
Testing for presence of env vars : 0 / 1
Testing for sane USE flag usage : 0 / 0
Total number of ebuilds with errors : 0 (0%)
Total number of ebuilds with warnings : 1 (100%)
Now I can see that the year in the ebuild is probably wrong, and that it is missing the SLOT variable. Fixing those eliminates all warnings.
It also handles removing packages, which is not covered here. Use
# epm -ql ethereal /usr/lib/ethereal/plugins/0.8.20/gryphon.so /usr/lib/ethereal/plugins/0.8.20/gryphon.la /usr/lib/ethereal/plugins/0.8.20/gryphon.a /usr/lib/ethereal/plugins/0.8.20/mgcp.so /usr/lib/ethereal/plugins/0.8.20/mgcp.la /usr/lib/ethereal/plugins/0.8.20/mgcp.a /usr/lib/ethereal/plugins/0.8.20/cosnaming.so /usr/lib/ethereal/plugins/0.8.20/cosnaming.la /usr/lib/ethereal/plugins/0.8.20/cosnaming.a /usr/lib/ethereal/plugins/0.8.20/coseventcomm.so /usr/lib/ethereal/plugins/0.8.20/coseventcomm.la /usr/lib/ethereal/plugins/0.8.20/coseventcomm.a /usr/bin/ethereal /usr/bin/editcap /usr/bin/mergecap /usr/bin/tethereal /usr/bin/text2pcap /usr/bin/idl2eth /usr/share/man/man1/idl2eth.1.gz /usr/share/man/man1/tethereal.1.gz /usr/share/man/man1/text2pcap.1.gz /usr/share/man/man1/editcap.1.gz /usr/share/man/man1/ethereal.1.gz /usr/share/man/man1/mergecap.1.gz /usr/share/doc/ethereal-0.8.20/AUTHORS.gz /usr/share/doc/ethereal-0.8.20/COPYING.gz /usr/share/doc/ethereal-0.8.20/NEWS.gz /usr/share/doc/ethereal-0.8.20/ChangeLog.gz /usr/share/doc/ethereal-0.8.20/README.gz /usr/share/doc/ethereal-0.8.20/INSTALL.configure.gz /usr/share/doc/ethereal-0.8.20/TODO.gz /usr/share/doc/ethereal-0.8.20/README.aix.gz /usr/share/doc/ethereal-0.8.20/README.bsd.gz /usr/share/doc/ethereal-0.8.20/README.hpux.gz /usr/share/doc/ethereal-0.8.20/README.irix.gz /usr/share/doc/ethereal-0.8.20/README.linux.gz /usr/share/doc/ethereal-0.8.20/README.tru64.gz /usr/share/doc/ethereal-0.8.20/README.win32.gz /usr/share/doc/ethereal-0.8.20/README.vmware.gz /etc/ethereal/manuf
# epm -qc ethereal /etc/ethereal/manuf # epm -qd ethereal /usr/share/man/man1/idl2eth.1.gz /usr/share/man/man1/tethereal.1.gz /usr/share/man/man1/text2pcap.1.gz /usr/share/man/man1/editcap.1.gz /usr/share/man/man1/ethereal.1.gz /usr/share/man/man1/mergecap.1.gz /usr/share/doc/ethereal-0.8.20/AUTHORS.gz /usr/share/doc/ethereal-0.8.20/COPYING.gz /usr/share/doc/ethereal-0.8.20/NEWS.gz /usr/share/doc/ethereal-0.8.20/ChangeLog.gz /usr/share/doc/ethereal-0.8.20/README.gz /usr/share/doc/ethereal-0.8.20/INSTALL.configure.gz /usr/share/doc/ethereal-0.8.20/TODO.gz /usr/share/doc/ethereal-0.8.20/README.aix.gz /usr/share/doc/ethereal-0.8.20/README.bsd.gz /usr/share/doc/ethereal-0.8.20/README.hpux.gz /usr/share/doc/ethereal-0.8.20/README.irix.gz /usr/share/doc/ethereal-0.8.20/README.linux.gz /usr/share/doc/ethereal-0.8.20/README.tru64.gz /usr/share/doc/ethereal-0.8.20/README.win32.gz /usr/share/doc/ethereal-0.8.20/README.vmware.gz
It is driven by a menu-based interface and includes the ability to view and merge in config files before deciding what to do.
gentool is a collective name for several small scripts that analyze ebuild statistics. For instance, gentool-total-coverage prints a list of email addresses and the number of ebuilds each has in the portage tree.
# pkg-size nmap net-analyzer/nmap-2.54_beta24-r1 897024 (876KB)
Downloads the daily snapshot over HTTP with wget, and (optionally) syncs with portage.