Skip navigation

recover your lost keywords

I mess up /etc/portage/package.keywords every so often, like this:

  echo "foo ~x86" > /etc/portage/package.keywords

A small typo — the > should be >> — that overwrites all the other keyword lines. Last night, I was on #gentoo and figured out how to get all the names of the testing packages back, using equery:

##  when i delete /etc/portage/package.keywords, this script
##  will recover the names of installed packages that are ~arch

fetch() {
  equery --no-pipe list

are_testing() {
  egrep '\[.~\]'

no_version() {
  sed -r 's/-[^-]+(-r[[:digit:]])?$//'

no_meta() {
  cut -d ']' -f 3 | cut -d ' ' -f 2

fetch | are_testing | no_meta | no_version 

Post a Comment

You must be logged in to post a comment.
%d bloggers like this: