Pruning Portage package config files
Today brought two changes to my Gentoo environment, one of which may benefit others: I
ditched eix and its convenience to rely solely
on the official tools (portage-utils and gentoolkit) and wrote a script to remove stale entries from my package.*
config files
(cf the wiki).
Here is the script in question: portage_pkgconf_gc
Like me, you'll probably always want to check the dry run (-r
) output before
applying anything, like so:
$ map 'portage_pkgconf_gc -r "$it"' /etc/portage/package.accept_keywords/* --- /etc/portage/package.accept_keywords/gentoo 2025-03-15 15:46:41.211484822 +0100 +++ - 2025-03-16 01:50:12.776947774 +0100 @@ -5,11 +5,9 @@ # (dependency required by "media-plugins/vs-denoise-2.4.0::vapoursynth" [ebuild]) # (dependency required by "media-plugins/vs-mlrt-13.1::vapoursynth[ncnn]" [ebuild]) -sci-libs/onnx::gentoo =app-editors/emacs-30.1::gentoo ~amd64 app-misc/radeontop::gentoo ~amd64 -app-text/zeal::gentoo ~amd64 dev-lisp/clozurecl::gentoo ~amd64 dev-lisp/sbcl::gentoo ~amd64 dev-util/clinfo::gentoo ~amd64 --- /etc/portage/package.accept_keywords/local 2025-03-01 16:35:20.911986859 +0100 +++ - 2025-03-16 01:50:13.052925105 +0100 @@ -1,7 +1,6 @@ # -*- mode: conf-unix; -*- app-crypt/tomb::local ~amd64 dev-python/pyvips::local ~amd64 -games-emulation/rpcs3::local ** games-fps/quake3e::local ~amd64 games-fps/raze::local ~amd64 games-fps/warsow::local ~amd64 @@ -13,8 +12,6 @@ dev-libs/dht::local ~amd64 dev-libs/libb64::local ~amd64 net-libs/libutp::local ~amd64 -www-client/nyxt::local ~amd64 - sys-libs/libfixposix::local ~amd64 x11-misc/lemonbar::local ~amd64 x11-wm/bspwm::local ** $ map 'portage_pkgconf_gc "$it"' /etc/portage/package.accept_keywords/*
Working fine here! Only tested on my own files, so caveat emptor…