This Time Self-Hosted
dark mode light mode Search

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 

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 🙂

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.