1 |
slyfox 17/08/12 16:30:06 |
2 |
|
3 |
Modified: locale-gen |
4 |
Log: |
5 |
glibc: make locale-gen parallel, bug #592300 |
6 |
|
7 |
Speed up locale generation on multicore machines. |
8 |
Patch is written by Tobias Klausmann. |
9 |
|
10 |
Bug: https://bugs.gentoo.org/592300 |
11 |
|
12 |
Revision Changes Path |
13 |
1.42 src/patchsets/glibc/extra/locale/locale-gen |
14 |
|
15 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/locale/locale-gen?rev=1.42&view=markup |
16 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/locale/locale-gen?rev=1.42&content-type=text/plain |
17 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/extra/locale/locale-gen?r1=1.41&r2=1.42 |
18 |
|
19 |
Index: locale-gen |
20 |
=================================================================== |
21 |
RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/extra/locale/locale-gen,v |
22 |
retrieving revision 1.41 |
23 |
retrieving revision 1.42 |
24 |
diff -u -r1.41 -r1.42 |
25 |
--- locale-gen 14 Oct 2015 13:55:56 -0000 1.41 |
26 |
+++ locale-gen 12 Aug 2017 16:30:06 -0000 1.42 |
27 |
@@ -52,7 +52,7 @@ |
28 |
} |
29 |
show_version() { |
30 |
local b="(" a=")" |
31 |
- local cvsver="$Revision: 1.41 $b $Date: 2015/10/14 13:55:56 $a" |
32 |
+ local cvsver="$Revision: 1.42 $b $Date: 2017/08/12 16:30:06 $a" |
33 |
echo "locale-gen-${cvsver//: }" |
34 |
exit 0 |
35 |
} |
36 |
@@ -149,15 +149,6 @@ |
37 |
done |
38 |
unset IFS |
39 |
|
40 |
-if ${LOCALE_ARCHIVE} ; then |
41 |
- if [[ ${JOBS_MAX} != 1 ]] ; then |
42 |
- ewarn "Generating locale-archive: forcing # of jobs to 1" |
43 |
- JOBS_MAX=1 |
44 |
- fi |
45 |
-else |
46 |
- LOCALEDEF_OPTS="--no-archive ${LOCALEDEF_OPTS}" |
47 |
-fi |
48 |
- |
49 |
[[ -n ${ALL} ]] && CONFIG=${SUPPORTED} |
50 |
|
51 |
# Extract the location of the locale dir on the fly as `localedef --help` has: |
52 |
@@ -256,6 +247,7 @@ |
53 |
x=$( |
54 |
[[ -n ${output} ]] && ebegin "${output}" |
55 |
"${DESTDIR}"usr/bin/localedef ${LOCALEDEF_OPTS} \ |
56 |
+ --no-archive \ |
57 |
-i "${input}" \ |
58 |
-f "${charmap}" \ |
59 |
-A "${ALIAS}" \ |
60 |
@@ -347,6 +339,33 @@ |
61 |
[[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ |
62 |
einfo "Generation complete" |
63 |
|
64 |
+if ${LOCALE_ARCHIVE} ; then |
65 |
+ ebegin "Adding locales to archive" |
66 |
+ # The pattern ends with / on purpose: we don't care about files (like |
67 |
+ # locale-archive) in the locale subdir, and we definitely don't want to |
68 |
+ # delete them! |
69 |
+ for LOC in "${LOCALEDIR}"/*/; do |
70 |
+ LOC=${LOC%/} # Strip trailing /, since localedef doesn't like it |
71 |
+ x=$( |
72 |
+ "${DESTDIR}"usr/bin/localedef \ |
73 |
+ --add-to-archive "${LOC}" \ |
74 |
+ --replace \ |
75 |
+ --prefix "${DESTDIR%${EPREFIX}/}/" |
76 |
+ ret=$? |
77 |
+ if [[ -n ${output} ]] ; then |
78 |
+ echo "${x}" |
79 |
+ elif [[ ${ret} -ne 0 ]] ; then |
80 |
+ eerror "${disp}: ${x}" |
81 |
+ fi |
82 |
+ if [[ $ret -eq 0 ]]; then |
83 |
+ rm -r "${LOC}" |
84 |
+ fi |
85 |
+ exit ${ret} |
86 |
+ ) |
87 |
+ done |
88 |
+ eend $ret |
89 |
+fi |
90 |
+ |
91 |
# Remove locales that existed but were not requested |
92 |
if [[ -n ${UPDATE} ]] ; then |
93 |
# Ignore these pseudo locales |