Alunduil's Hosting Gentoo Hackery and Other Fun …

11Jan/10

Layman Overlay

My Overlay

My overlay has been available via subversion for quite some time now, but not in any easy to use format (integration with layman).  Getting this overlay to work with yours must have been a pain if you wanted to try something I had been working on.

Making My Overlay Available

The first thing I had to do to make my overlay talk with layman let alone get along with layman was add an xml definition of the overlay somewhere.  I chose the easy to manipulate path of http://www.alunduil.com/svn/portage/trunk/portage/alunduil-overlay.xml.

Adding My Overlay List to Your Layman

To add my overlay(s) to your layman list simply add the following path to your overlays variable in /etc/layman/layman.cfg: http://www.alunduil.com/svn/portage/trunk/portage/alunduil-overlay.xml.

23Jul/09

Cleaning /etc/portage/package.*

Inroduction

After a while the files in /etc/portage become cluttered with the common, "Let's try this . . . whoops that didn't work . . . let's try this." No matter how hard you try to keep this clean you have probably forgotten something along the way. Installing a testing package then removing it because you found a better one later, etc. Well what's an easy way to clean these files up and make sure that we minimize their sizes and keep our Gentoo system crisp (or as crisp as we can by just managing these files)? I've written some bash one-liners that assist with this and could easily be adapted into a script that automates a lot of the cleaning for you.

In all of these scripts change the /etc/portage/package.use to the file you are interested in cleaning.

Checking for Multiple Occurrences of an Atom Within a File

for atom in $(gawk '{print $1}' /etc/portage/package.use); do [ "$(grep ${atom} /etc/portage/package.use | wc -l)" -gt "1" ] && echo "${atom}"; done

Checking for N Uses of a Use Flag in /etc/portage/package.use

I use this to move frequently used use flags to /etc/make.conf if it seems appropriate.

for flag in $(gawk '{print $2}' /etc/portage/package.use); do [ "$(grep "${flag}" /etc/portage/package.use | wc -l)" -gt "2" ] && echo "${flag}"; done

Checking for Removed Atoms Within a File

for atom in $(gawk '{print $1}' /etc/portage/package.use); do [ "$(portageq match / ${atom} | wc -l)" -lt "1" ] && echo "${atom}"; done