Accepting request 607198 from home:pcerny:factory

parellelise locales building (package build speedup 10%+)

OBS-URL: https://build.opensuse.org/request/show/607198
OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=660
This commit is contained in:
Wolfgang Rosenauer 2018-05-14 16:04:59 +00:00 committed by Git OBS Bridge
parent 19ab3bdb06
commit eef38bbb12
2 changed files with 33 additions and 31 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon May 14 13:37:38 UTC 2018 - pcerny@suse.com
- parellelise locales building
------------------------------------------------------------------- -------------------------------------------------------------------
Mon May 7 08:32:28 UTC 2018 - wr@rosenauer.org Mon May 7 08:32:28 UTC 2018 - wr@rosenauer.org

View File

@ -413,35 +413,31 @@ install -m 644 %{SOURCE6} %{buildroot}%{progdir}/browser/defaults/preferences/kd
install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
# install additional locales # install additional locales
%if %localize %if %localize
rm -f %{_tmppath}/translations.* truncate -s 0 %{_tmppath}/translations.{common,other}
touch %{_tmppath}/translations.{common,other} sed -r '/^(ja-JP-mac|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{source_prefix}/browser/locales/shipped-locales \
for locale in $(cat $RPM_BUILD_DIR/%{source_prefix}/browser/locales/shipped-locales) ; do | xargs -P 8 -n 1 -I {} /bin/sh -c '
case $locale in locale=$1
ja-JP-mac|en-US|'') pushd $RPM_BUILD_DIR/compare-locales
;; PYTHONPATH=lib \
*) scripts/compare-locales -m ../l10n-merged/$locale \
pushd $RPM_BUILD_DIR/compare-locales ../%{source_prefix}/browser/locales/l10n.ini ../l10n $locale
PYTHONPATH=lib \ popd
scripts/compare-locales -m ../l10n-merged/$locale \ LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \
../%{source_prefix}/browser/locales/l10n.ini ../l10n $locale make -C browser/locales langpack-$locale
popd cp -rL dist/xpi-stage/locale-$locale \
LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \ %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org
make -C browser/locales langpack-$locale # remove prefs, profile defaults, and hyphenation from langpack
cp -rL dist/xpi-stage/locale-$locale \ rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
%{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
# remove prefs, profile defaults, and hyphenation from langpack # check against the fixed common list and sort into the right filelist
rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults _matched=0
rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation for _match in ar ca cs da de en-GB el es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do
# check against the fixed common list and sort into the right filelist [ "$_match" = "$locale" ] && _matched=1
_matched=0 done
for _match in ar ca cs da de en-GB el es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
[ "$_match" = "$locale" ] && _matched=1 echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
done >> %{_tmppath}/translations.$_l10ntarget
[ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other ' -- {}
echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
>> %{_tmppath}/translations.$_l10ntarget
esac
done
%endif %endif
# remove some executable permissions # remove some executable permissions
find %{buildroot}%{progdir} \ find %{buildroot}%{progdir} \
@ -452,9 +448,10 @@ find %{buildroot}%{progdir} \
-name "*.dtd" -o \ -name "*.dtd" -o \
-name "*.txt" -o \ -name "*.txt" -o \
-name "*.xml" -o \ -name "*.xml" -o \
-name "*.css" | xargs chmod a-x -name "*.css" \
-exec chmod a-x {} +
# remove mkdir.done files from installed base # remove mkdir.done files from installed base
find %{buildroot}%{progdir} -name ".mkdir.done" | xargs rm || : find %{buildroot}%{progdir} -type f -name ".mkdir.done" -delete
# overwrite the mozilla start-script and link it to /usr/bin # overwrite the mozilla start-script and link it to /usr/bin
mkdir --parents %{buildroot}/usr/bin mkdir --parents %{buildroot}/usr/bin
sed "s:%%PREFIX:%{_prefix}:g sed "s:%%PREFIX:%{_prefix}:g