I was looking to use localepurge on my Gentoo box and saw that it would be too easy to purge locales I would rather keep. So I edited /usr/bin/localepurge to add 2 new features: 1) A pretend option which displays the directories which would be purged. 2) The ability to use regex patterns in the locale.nopurge file; i.e.: "es.*" would not purge any Spanish locales or "en_US.*" would not purge any US English locales. This is accomplished by using the locale.nopurge file as a pattern to prune the LOCALELIST in memory, then using this pruned list to check for directories to purge. I am attaching the diff file between /usr/bin/localepurge (0.5.1) and my revisions in localepurge.new Also, while working on this, I noticed that if no options were specified on the command line, the VERBOSE and NOCOLOR options in /etc/locale.nopurge were never checked. This is also addressed in the diff file.
Created attachment 92021 [details, diff] diff file to add pretend and regex configuration
tahnks for the paatch, it is now in 0.5.2 :)