slyfox 17/08/12 16:30:06 Modified: locale-gen Log: glibc: make locale-gen parallel, bug #592300 Speed up locale generation on multicore machines. Patch is written by Tobias Klausmann. Bug: https://bugs.gentoo.org/592300
Revision Changes Path 1.42 src/patchsets/glibc/extra/locale/locale-gen file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/locale/locale-gen?rev=1.42&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/locale/locale-gen?rev=1.42&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/locale/locale-gen?r1=1.41&r2=1.42 Index: locale-gen =================================================================== RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/extra/locale/locale-gen,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- locale-gen 14 Oct 2015 13:55:56 -0000 1.41 +++ locale-gen 12 Aug 2017 16:30:06 -0000 1.42 @@ -52,7 +52,7 @@ } show_version() { local b="(" a=")" - local cvsver="$Revision: 1.41 $b $Date: 2015/10/14 13:55:56 $a" + local cvsver="$Revision: 1.42 $b $Date: 2017/08/12 16:30:06 $a" echo "locale-gen-${cvsver//: }" exit 0 } @@ -149,15 +149,6 @@ done unset IFS -if ${LOCALE_ARCHIVE} ; then - if [[ ${JOBS_MAX} != 1 ]] ; then - ewarn "Generating locale-archive: forcing # of jobs to 1" - JOBS_MAX=1 - fi -else - LOCALEDEF_OPTS="--no-archive ${LOCALEDEF_OPTS}" -fi - [[ -n ${ALL} ]] && CONFIG=${SUPPORTED} # Extract the location of the locale dir on the fly as `localedef --help` has: @@ -256,6 +247,7 @@ x=$( [[ -n ${output} ]] && ebegin "${output}" "${DESTDIR}"usr/bin/localedef ${LOCALEDEF_OPTS} \ + --no-archive \ -i "${input}" \ -f "${charmap}" \ -A "${ALIAS}" \ @@ -347,6 +339,33 @@ [[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ einfo "Generation complete" +if ${LOCALE_ARCHIVE} ; then + ebegin "Adding locales to archive" + # The pattern ends with / on purpose: we don't care about files (like + # locale-archive) in the locale subdir, and we definitely don't want to + # delete them! + for LOC in "${LOCALEDIR}"/*/; do + LOC=${LOC%/} # Strip trailing /, since localedef doesn't like it + x=$( + "${DESTDIR}"usr/bin/localedef \ + --add-to-archive "${LOC}" \ + --replace \ + --prefix "${DESTDIR%${EPREFIX}/}/" + ret=$? + if [[ -n ${output} ]] ; then + echo "${x}" + elif [[ ${ret} -ne 0 ]] ; then + eerror "${disp}: ${x}" + fi + if [[ $ret -eq 0 ]]; then + rm -r "${LOC}" + fi + exit ${ret} + ) + done + eend $ret +fi + # Remove locales that existed but were not requested if [[ -n ${UPDATE} ]] ; then # Ignore these pseudo locales
