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
You might want to run a qcheck -u $pkgname after it’s been localepurgedqcheck -a ; to see what whats missing.