From dbff3cd051b4f433b2ba2cf335b28513a4f5b304477f6eb3a0978cafa5d7e750 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Tue, 24 May 2011 13:52:34 +0000 Subject: [PATCH] - 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 --- translation-update-upstream.changes | 5 +++++ translation-update-upstream.spec | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/translation-update-upstream.changes b/translation-update-upstream.changes index 3437748..c094f0c 100644 --- a/translation-update-upstream.changes +++ b/translation-update-upstream.changes @@ -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 diff --git a/translation-update-upstream.spec b/translation-update-upstream.spec index 7774777..ae439f6 100644 --- a/translation-update-upstream.spec +++ b/translation-update-upstream.spec @@ -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 # +set +x 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 + for file in $RPM_BUILD_ROOT%{_datadir}/translation*/*/*/$LOCALE.po; do + # fake it so it looks like removed from %find_lang + 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 %clean