Another nice trick with localepurge

I sent this originally to gentoo-dev when Tuan Van asked for a tool for removing locale data that you don’t really need.
I wrote this code at the moment when I wrote the mail, but it worked fine…

So, just emerge localepurge, configure /etc/locale.nopurge (the documentation is inline and quite simple), then add this to /etc/portage/bashrc:

if [[ ${EBUILD_PHASE} == "postinst" ]]; then 
    einfo "Running localepurge..." 
    PATH="/bin:/usr/bin" localepurge 
fi

at this point after every merge it will remove the non-required data :)

I still have to check if this works on Gentoo/FreeBSD but I suppose so, if it does not, I’ll try to fix it ;)

Thanks also to Hydrogen who posted it on Forums :)
For who wants to get the original mail, look here.

Now I hope this can be useful :)

One thought on “Another nice trick with localepurge

  1. You might want to run a qcheck -u $pkgname after it’s been localepurgedqcheck -a ; to see what whats missing.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s