diff --git a/translation-update-upstream.changes b/translation-update-upstream.changes index 86195a0..1ac4330 100644 --- a/translation-update-upstream.changes +++ b/translation-update-upstream.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 14 18:10:56 CET 2010 - sbrabec@suse.cz + +- Validate locales and remove invalid ones (bnc#658999). + ------------------------------------------------------------------- Mon Jun 14 20:22:26 CEST 2010 - sbrabec@suse.cz diff --git a/translation-update-upstream.spec b/translation-update-upstream.spec index c852b69..0276788 100644 --- a/translation-update-upstream.spec +++ b/translation-update-upstream.spec @@ -99,9 +99,37 @@ install -m0755 msgheadermerge msgheadermerge-compose msgheadermerge-parse $RPM_B install -m0644 msgheadermerge-empty.pot $RPM_BUILD_ROOT%{_prefix}/lib/translation-update-upstream/ ln -s translation-update-upstream $RPM_BUILD_ROOT%{_bindir}/translation-update-tool # -# gnome-i18n says nds_FME is wrong, remove until upstream clearified that # +# obsolete or bad locales +# +# gnome-i18n says nds_NFE is wrong, remove until upstream clearified that rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/nds?NFE.po +# +# invalid locales +# +# should be @latin +rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/*@Latn.po +# should be nb +rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/no.po +# should be nb +rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/no_nb.po +# should be ar +rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/ara.po +# testing locale, should not appear in packages +rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/en_IGID.po +# short form of these locales should be used +rm -fv $RPM_BUILD_ROOT%{_datadir}/%{name}/po/*/my_MM.po +# +# go through valid locales and fail in invalid ones +# +cd $RPM_BUILD_ROOT%{_datadir} ; +echo translation*/*/*.po | sed 's:.*/::;s:\.po$::' | sort -u +for LOCALE in $(set +x ; cd $RPM_BUILD_ROOT%{_datadir} ; ls -1 translation*/*/*/*.po | sed 's:.*/::;s:\.po$::' | sort -u) ; do + if ! test -d /usr/share/locale/$LOCALE ; then + echo "Invalid locale $LOCALE! Please fix (delete, rename or add to filesystem package)." + exit 1 + fi +done %clean rm -rf $RPM_BUILD_ROOT