Index: =================================================================== RCS file: /var/cvsroot/gentoo-x86/app-text/po4a/po4a-0.45-r1.ebuild,v --- 1.2 +++ @@ -7,0 +7,3 @@ +PLOCALES="af ca cs da de eo es et eu fr hr id it ja kn ko nb nl pl pt_BR pt ru sl sv uk vi zh_CN zh_HK" +PLOCALES_BACKUP="en" + @@ -9,1 +12,1 @@ -inherit perl-app --- +inherit perl-app perl-module l10n @@ -36,0 +39,26 @@ + +src_prepare() { + # Check against locale files in ${S}/pod/bin for mismatches + # with languages listed in PLOCALES + local locales_path="$S/po/bin" + l10n_find_plocales_changes "$locales_path" "" ".po" + + # Array containing locale files to remove + local locales_to_remove=( ) + + # Get rid of disabled locales + my_get_disabled_locales() { + local locale=$1 + local locale_abs_path="$locales_path/$locale.po" + locales_to_remove+=$locale_abs_path + } + + l10n_for_each_disabled_locale_do my_get_disabled_locales + + einfo "Your LINGUAS contains the following locales: $LINGUAS" + einfo "Removing locale files not listed in it ..." + + # perl_rm_files also updates the Manifest file + # and therefore silences Perl as to .po files we're about to clean + perl_rm_files "${locales_to_remove[@]}" +}