- fake %find_lang as if the translations are provided by the packages

OBS-URL: https://build.opensuse.org/package/show/Base:System/translation-update-upstream?expand=0&rev=20
This commit is contained in:
Stephan Kulow 2011-05-24 13:52:34 +00:00 committed by Git OBS Bridge
parent 492f526364
commit dbff3cd051
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue May 24 13:52:12 UTC 2011 - coolo@novell.com
- fake %find_lang as if the translations are provided by the packages
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Feb 23 17:11:45 CET 2011 - sbrabec@suse.cz Wed Feb 23 17:11:45 CET 2011 - sbrabec@suse.cz

View File

@ -126,13 +126,18 @@ rm -v $RPM_BUILD_ROOT%{_datadir}/%{name}/po/glib-networking/master.po
# #
# go through valid locales and fail in invalid ones # go through valid locales and fail in invalid ones
# #
set +x
cd $RPM_BUILD_ROOT%{_datadir} ; cd $RPM_BUILD_ROOT%{_datadir} ;
echo translation*/*/*.po | sed 's:.*/::;s:\.po$::' | sort -u 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 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 if ! test -d /usr/share/locale/$LOCALE ; then
echo "Invalid locale $LOCALE! Please fix (delete, rename or add to filesystem package)." for file in $RPM_BUILD_ROOT%{_datadir}/translation*/*/*/$LOCALE.po; do
exit 1 # fake it so it looks like removed from %find_lang
fi package=$(echo $file | sed -e 's,.*translation[^/]*/po/,,; s,/[^/]*.po,,')
echo -n "removing translation /usr/share/locale/$LOCALE/LC_MESSAGES/$package.mo: "
msgfmt -o - $file | msgunfmt -o - -| msgfmt --statistics -o /dev/null -
done
fi
done done
%clean %clean