1 |
commit: 31c0603dae06a4bb3508e6960827fa9895e5f3d7 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 9 22:31:17 2017 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 9 22:31:17 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=31c0603d |
7 |
|
8 |
Add current files (as of sys-libs/glibc-2.25-r9 and sys-libs/glibc-2.26-r2) |
9 |
|
10 |
README | 1 + |
11 |
locale-gen | 384 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
locale-gen.8 | 69 +++++++++++ |
13 |
locale.gen | 36 ++++++ |
14 |
locale.gen.5 | 77 ++++++++++++ |
15 |
5 files changed, 567 insertions(+) |
16 |
|
17 |
diff --git a/README b/README |
18 |
new file mode 100644 |
19 |
index 0000000..2d5a3f0 |
20 |
--- /dev/null |
21 |
+++ b/README |
22 |
@@ -0,0 +1 @@ |
23 |
+A port/rewrite of Debian's locale-gen. See the man pages for more information. |
24 |
|
25 |
diff --git a/locale-gen b/locale-gen |
26 |
new file mode 100755 |
27 |
index 0000000..6653cad |
28 |
--- /dev/null |
29 |
+++ b/locale-gen |
30 |
@@ -0,0 +1,384 @@ |
31 |
+#!/bin/bash |
32 |
+ |
33 |
+# |
34 |
+# Based upon Debian's locale-gen, fetched from glibc_2.3.6-7.diff.gz |
35 |
+# |
36 |
+ |
37 |
+unset POSIXLY_CORRECT IFS |
38 |
+umask 0022 |
39 |
+ |
40 |
+argv0=${0##*/} |
41 |
+ |
42 |
+EPREFIX="@GENTOO_PORTAGE_EPREFIX@" |
43 |
+if [[ ${EPREFIX} == "@"GENTOO_PORTAGE_EPREFIX"@" ]] ; then |
44 |
+ EPREFIX="" |
45 |
+fi |
46 |
+ |
47 |
+FUNCTIONS_SH="/lib/gentoo/functions.sh" |
48 |
+source "${EPREFIX}"${FUNCTIONS_SH} || { |
49 |
+ echo "${argv0}: Could not source ${FUNCTIONS_SH}!" 1>&2 |
50 |
+ exit 1 |
51 |
+} |
52 |
+ |
53 |
+show_usage() { |
54 |
+ cat <<-EOF |
55 |
+ Usage: ${HILITE}${argv0}${NORMAL} ${GOOD}[options]${NORMAL} -- ${GOOD}[localedef options]${NORMAL} |
56 |
+ |
57 |
+ Generate locales based upon the config file /etc/locale.gen. |
58 |
+ |
59 |
+ ${HILITE}Options:${NORMAL} |
60 |
+ ${GOOD}-k, --keep${NORMAL} Don't nuke existing locales |
61 |
+ ${GOOD}-d, --destdir <dir>${NORMAL} Use locale data in specified DESTDIR tree |
62 |
+ ${GOOD}-c, --config <config>${NORMAL} Use specified config instead of default locale.gen |
63 |
+ ${GOOD}-l, --list${NORMAL} List all the locales to be generated |
64 |
+ ${GOOD}-a, --ask${NORMAL} Ask before generating each locale |
65 |
+ ${GOOD}-A, --all${NORMAL} Pretend the locale list contains all locales |
66 |
+ ${GOOD}-u, --update${NORMAL} Only generate locales that are missing |
67 |
+ ${GOOD}-G, --generate <locale>${NORMAL} Generate specified locale (one shot; implies -k -u) |
68 |
+ ${GOOD}-j, --jobs <num>${NORMAL} Number of locales to generate at a time (parallel) |
69 |
+ ${GOOD}-q, --quiet${NORMAL} Only show errors |
70 |
+ ${GOOD}-V, --version${NORMAL} Meaningless version information |
71 |
+ ${GOOD}-h, --help${NORMAL} Show this help cruft |
72 |
+ |
73 |
+ ${HILITE}Localedef Options:${NORMAL} |
74 |
+ By default, ${GOOD}${LOCALEDEF_OPTS}${NORMAL} is passed to localedef. |
75 |
+ |
76 |
+ For more info, see the ${HILITE}locale-gen${NORMAL}(1) and ${HILITE}locale.gen${NORMAL}(8) manpages. |
77 |
+ EOF |
78 |
+ [[ $# -eq 0 ]] && exit 0 |
79 |
+ echo "" |
80 |
+ eerror "Unknown option '$1'" |
81 |
+ exit 1 |
82 |
+} |
83 |
+show_version() { |
84 |
+ local b="(" a=")" |
85 |
+ local cvsver="$Revision: 1.42 $b $Date: 2017/08/12 16:30:06 $a" |
86 |
+ echo "locale-gen-${cvsver//: }" |
87 |
+ exit 0 |
88 |
+} |
89 |
+ |
90 |
+ |
91 |
+ |
92 |
+LOCALEDEF_OPTS="-c" |
93 |
+KEEP="" |
94 |
+DESTDIR="" |
95 |
+CONFIG="" |
96 |
+JUST_LIST="" |
97 |
+ASK="" |
98 |
+ALL="" |
99 |
+UPDATE="" |
100 |
+GENERATE="" |
101 |
+JOBS_MAX="" |
102 |
+QUIET=0 |
103 |
+SET_X="" |
104 |
+LOCALE_ARCHIVE=true |
105 |
+while [[ $# -gt 0 ]] ; do |
106 |
+ case $1 in |
107 |
+ -k|--keep|--keep-existing) KEEP=$1;; |
108 |
+ -d|--destdir) shift; DESTDIR=$1; unset ROOT;; |
109 |
+ -c|--config) shift; CONFIG=$1;; |
110 |
+ -l|--list) JUST_LIST=$1;; |
111 |
+ -a|--ask) ASK=$1;; |
112 |
+ -A|--all) ALL=$1;; |
113 |
+ -u|--update) UPDATE=$1;; |
114 |
+ -G|--generate) shift; GENERATE=$1;; |
115 |
+ -j|--jobs) shift; JOBS_MAX=$(( $1 ));; |
116 |
+ -j*) : $(( JOBS_MAX = ${1#-j} ));; |
117 |
+ -q|--quiet) : $(( ++QUIET ));; |
118 |
+ -x|--debug) SET_X="true";; |
119 |
+ -V|--version) show_version;; |
120 |
+ -h|--help) show_usage;; |
121 |
+ --) shift; LOCALEDEF_OPTS=$*; break;; |
122 |
+ *) show_usage $1;; |
123 |
+ esac |
124 |
+ shift |
125 |
+done |
126 |
+if [[ -z ${JOBS_MAX} ]] ; then |
127 |
+ JOBS_MAX=$(getconf _NPROCESSORS_ONLN 2>/dev/null) |
128 |
+ : ${JOBS_MAX:=1} |
129 |
+fi |
130 |
+[[ ${JOBS_MAX} -lt 1 ]] && JOBS_MAX=1 |
131 |
+[[ -n ${SET_X} ]] && set -x |
132 |
+: ${KEEP:=${JUST_LIST}} |
133 |
+[[ -n ${GENERATE} ]] && UPDATE="true" && KEEP="true" |
134 |
+ |
135 |
+: ${ROOT:=/} |
136 |
+ROOT="${ROOT%/}/" |
137 |
+if [[ -n ${DESTDIR} ]] && [[ ${ROOT} != "/" ]] ; then |
138 |
+ eerror "DESTDIR and ROOT are mutually exclusive options" |
139 |
+ exit 1 |
140 |
+fi |
141 |
+: ${EROOT:="${ROOT%/}${EPREFIX}/"} |
142 |
+if [[ ${EROOT} != "/" ]] ; then |
143 |
+ einfo "Using locale.gen from ROOT ${EROOT}etc/" |
144 |
+fi |
145 |
+if [[ -n ${DESTDIR} ]] ; then |
146 |
+ einfo "Building locales in DESTDIR '${DESTDIR}'" |
147 |
+else |
148 |
+ DESTDIR=${EROOT} |
149 |
+fi |
150 |
+ |
151 |
+# XXX: should fix this ... |
152 |
+if [[ ${ROOT} != "/" ]] ; then |
153 |
+ eerror "Sorry, but ROOT support is incomplete at this time." |
154 |
+ exit 0 |
155 |
+fi |
156 |
+ |
157 |
+: ${CONFIG:=${EROOT}etc/locale.gen} |
158 |
+LOCALES=${DESTDIR}usr/share/i18n/locales |
159 |
+CHARMAPS=${DESTDIR}usr/share/i18n/charmaps |
160 |
+SUPPORTED=${DESTDIR}usr/share/i18n/SUPPORTED |
161 |
+ALIAS=${DESTDIR}usr/share/locale/locale.alias |
162 |
+ |
163 |
+# |
164 |
+# Grab any user options in their config file |
165 |
+options=$(sed -n \ |
166 |
+ -e '/^[[:space:]]*#%/s:^[[:space:]]*#%[[:space:]]*::p'\ |
167 |
+ "${CONFIG}" 2>/dev/null |
168 |
+) |
169 |
+IFS=$'\n' |
170 |
+for option in ${options} ; do |
171 |
+ case ${option} in |
172 |
+ no-locale-archive) |
173 |
+ LOCALE_ARCHIVE=false |
174 |
+ ;; |
175 |
+ *) |
176 |
+ ewarn "Unrecognized option '${option}'" |
177 |
+ ;; |
178 |
+ esac |
179 |
+done |
180 |
+unset IFS |
181 |
+ |
182 |
+[[ -n ${ALL} ]] && CONFIG=${SUPPORTED} |
183 |
+ |
184 |
+# Extract the location of the locale dir on the fly as `localedef --help` has: |
185 |
+# locale path : /usr/lib64/locale:/usr/share/i18n |
186 |
+# For long paths, the line may get wrapped into two, in which case space (' ') is replaced |
187 |
+# by newline (\n). |
188 |
+LOCALEDIR=$(LC_ALL="C" "${DESTDIR}"usr/bin/localedef --help | sed -n -r '/locale path/{N;s|.*:[ \n](.*):/.*|\1|;p}') |
189 |
+LOCALEDIR="${DESTDIR}${LOCALEDIR#${EPREFIX}}" |
190 |
+if [[ $? -ne 0 ]] || [[ -z ${LOCALEDIR} ]] || [[ ${LOCALEDIR} != ${DESTDIR}/usr/lib*/locale ]] ; then |
191 |
+ eerror "Unable to parse the output of your localedef utility." 1>&2 |
192 |
+ eerror "File a bug about this issue and include the output of 'localedef --help'." 1>&2 |
193 |
+ exit 1 |
194 |
+fi |
195 |
+ |
196 |
+# Only generate locales the user specified before falling back to the config. |
197 |
+locales_to_generate=${GENERATE} |
198 |
+ |
199 |
+if [[ -z ${locales_to_generate} ]] && [[ -e ${CONFIG} ]] ; then |
200 |
+ locales_to_generate=$(sed \ |
201 |
+ -e 's:#.*::' \ |
202 |
+ -e '/^[[:space:]]*$/d' \ |
203 |
+ "${CONFIG}" | sort) |
204 |
+ # Sanity check to make sure people did not duplicate entries. #550884 |
205 |
+ # The first column must be unique specifically. #235555 |
206 |
+ dup_locales_to_generate=$( |
207 |
+ echo "${locales_to_generate}" | \ |
208 |
+ awk '{ if ($1 == last) { print lastline; print; } else { lastline = $0; last = $1; } }') |
209 |
+ if [[ -n ${dup_locales_to_generate} ]] ; then |
210 |
+ ewarn "These locales have been duplicated in your config:\n${dup_locales_to_generate}" |
211 |
+ ewarn "Some might be filtered, but you must fix it." |
212 |
+ locales_to_generate=$(echo "${locales_to_generate}" | uniq) |
213 |
+ fi |
214 |
+fi |
215 |
+ |
216 |
+if [[ -z ${locales_to_generate} ]] ; then |
217 |
+ [[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ |
218 |
+ ewarn "No locales found" |
219 |
+ exit 0 |
220 |
+fi |
221 |
+ |
222 |
+mkdir -p "${LOCALEDIR}" |
223 |
+if [[ -z ${KEEP} && -z ${UPDATE} ]] ; then |
224 |
+ # Remove all old locale dir and locale-archive before generating new |
225 |
+ # locale data. Scrubbing via update is done elsewhere. |
226 |
+ rm -rf "${LOCALEDIR}"/* || true |
227 |
+fi |
228 |
+ |
229 |
+# Transform the name in locales.gen to the name used when storing |
230 |
+# the locale data in /usr/lib/locale/ ... this normalize algo is |
231 |
+# taken out of the glibc localedef source code ... |
232 |
+normalize() { |
233 |
+ if [[ $1 == *.* ]] ; then |
234 |
+ local ret=$(echo ${1##*.} | tr '[[:upper:]]' '[[:lower:]]') |
235 |
+ echo ${1%%.*}.${ret//-} |
236 |
+ else |
237 |
+ echo $1 |
238 |
+ fi |
239 |
+} |
240 |
+ |
241 |
+# These funky sed's are based on the stuff in glibc's localedata/Makefile |
242 |
+# Basically we want to rewrite the display like so: |
243 |
+# <locale without a . or @>.<charmap>[@extra stuff after the @ in the locale] |
244 |
+# en_US ISO-8859-1 -> en_US.ISO-8859-1 |
245 |
+# en_US.UTF-8 UTF-8 -> en_US.UTF-8 |
246 |
+# de_DE@euro ISO-8859-15 -> de_DE.ISO-8859-15@euro |
247 |
+locales_disp=$(echo "${locales_to_generate}" | sed \ |
248 |
+ -e ' /@/ s:[[:space:]]*\([^@[:space:]]*\)\([^[:space:]]*\)[[:space:]]\+\([^[:space:]]*\):\1.\3\2:' \ |
249 |
+ -e '/^[^@]*$/s:[[:space:]]*\([^.[:space:]]*\)\([^[:space:]]*\)[[:space:]]\+\([^[:space:]]*\):\1.\3:') |
250 |
+ |
251 |
+eval declare -a locales_disp=(${locales_disp}) |
252 |
+eval declare -a locales_to_generate=(${locales_to_generate}) |
253 |
+total=$(( ${#locales_to_generate[*]} / 2 )) |
254 |
+ |
255 |
+[[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ |
256 |
+einfo "Generating ${total} locales (this might take a while) with ${JOBS_MAX} jobs" |
257 |
+ |
258 |
+if [[ -n ${UPDATE} ]] ; then |
259 |
+ # normalize newlines into spaces |
260 |
+ existing_locales=" $(echo $(locale -a 2>/dev/null)) " |
261 |
+fi |
262 |
+ |
263 |
+generate_locale() { |
264 |
+ local output="" |
265 |
+ |
266 |
+ if [[ -z ${ASK} ]] && [[ ${QUIET} -eq 0 ]] ; then |
267 |
+ output=" (${cnt_fmt}/${total}) Generating ${disp}" |
268 |
+ fi |
269 |
+ |
270 |
+ if [[ $(( JOB_IDX_E - JOB_IDX_S )) == ${JOBS_MAX} ]] ; then |
271 |
+ wait ${JOB_PIDS[$(( JOB_IDX_S++ ))]} |
272 |
+ JOB_RETS+=( $? ) |
273 |
+ fi |
274 |
+ ( |
275 |
+ # Accumulate all the output in one go so the parallel |
276 |
+ # jobs don't tromp on each other |
277 |
+ x=$( |
278 |
+ [[ -n ${output} ]] && ebegin "${output}" |
279 |
+ "${DESTDIR}"usr/bin/localedef ${LOCALEDEF_OPTS} \ |
280 |
+ --no-archive \ |
281 |
+ -i "${input}" \ |
282 |
+ -f "${charmap}" \ |
283 |
+ -A "${ALIAS}" \ |
284 |
+ --prefix "${DESTDIR%${EPREFIX}/}/" \ |
285 |
+ "${locale}" 2>&1 |
286 |
+ ret=$? |
287 |
+ [[ -n ${output} ]] && eend ${ret} |
288 |
+ exit ${ret} |
289 |
+ ) |
290 |
+ ret=$? |
291 |
+ if [[ -n ${output} ]] ; then |
292 |
+ echo "${x}" |
293 |
+ elif [[ ${ret} -ne 0 ]] ; then |
294 |
+ eerror "${disp}: ${x}" |
295 |
+ fi |
296 |
+ exit ${ret} |
297 |
+ ) & |
298 |
+ JOB_PIDS+=( $! ) |
299 |
+ : $(( ++JOB_IDX_E )) |
300 |
+ |
301 |
+ if [[ ${ret} != 0 && ${locale} == */* ]] ; then |
302 |
+ ewarn "Perhaps you meant to use a space instead of a / in your config file ?" |
303 |
+ fi |
304 |
+} |
305 |
+ |
306 |
+JOB_PIDS=() |
307 |
+JOB_RETS=() |
308 |
+JOB_IDX_S=0 |
309 |
+JOB_IDX_E=0 |
310 |
+cnt=0 |
311 |
+lidx=0 |
312 |
+while [[ -n ${locales_to_generate[${lidx}]} ]] ; do |
313 |
+ : $(( ++cnt )) |
314 |
+ locale=${locales_to_generate[$((lidx++))]} |
315 |
+ charmap=${locales_to_generate[$((lidx++))]} |
316 |
+ |
317 |
+ # XXX: if we wanted to, we could check existence of |
318 |
+ # ${LOCALES}/${locale} and ${CHARMAPS}/${charmap} |
319 |
+ # this would fail for things like "en_US.UTF8", but |
320 |
+ # in that case we could fall back to checking the |
321 |
+ # SUPPORTED file ... then again, the localedef |
322 |
+ # below will abort nicely for us ... |
323 |
+ if [[ -z ${locale} || -z ${charmap} ]] ; then |
324 |
+ eerror "Bad entry in locale.gen: '${locale} ${charmap}'; skipping" |
325 |
+ continue |
326 |
+ fi |
327 |
+ |
328 |
+ disp=${locales_disp[$(( cnt - 1 ))]} |
329 |
+ |
330 |
+ if [[ -n ${UPDATE} ]] ; then |
331 |
+ normalized_locale=$(normalize ${locale}) |
332 |
+ if [[ ${existing_locales} == *" ${normalized_locale} "* ]] ; then |
333 |
+ existing_locales=${existing_locales/ ${normalized_locale} / } |
334 |
+ if [[ ${QUIET} -eq 0 ]] ; then |
335 |
+ cnt_fmt=$(printf "%${#total}i" ${cnt}) |
336 |
+ einfo " (${cnt_fmt}/${total}) Skipping ${disp}" |
337 |
+ fi |
338 |
+ continue |
339 |
+ fi |
340 |
+ fi |
341 |
+ |
342 |
+ # If the locale is like 'en_US.UTF8', then we really want 'en_US' |
343 |
+ if [[ -f ${LOCALES}/${locale} ]] ; then |
344 |
+ input=${locale} |
345 |
+ else |
346 |
+ input=${locale%%.*} |
347 |
+ fi |
348 |
+ |
349 |
+ if [[ -z ${JUST_LIST} ]] ; then |
350 |
+ # Format the output for the question/status |
351 |
+ cnt_fmt=$(printf "%${#total}i" ${cnt}) |
352 |
+ if [[ -n ${ASK} ]] ; then |
353 |
+ einfon " (${cnt_fmt}/${total}) Generate ${disp} ? (Y/n) " |
354 |
+ read user_answer |
355 |
+ [[ ${user_answer} == [nN]* ]] && continue |
356 |
+ fi |
357 |
+ generate_locale |
358 |
+ else |
359 |
+ echo "${disp}" |
360 |
+ fi |
361 |
+done |
362 |
+ |
363 |
+for (( i = JOB_IDX_S; i < JOB_IDX_E; ++i )) ; do |
364 |
+ wait ${JOB_PIDS[i]} |
365 |
+ JOB_RETS+=( $? ) |
366 |
+done |
367 |
+ret=$(( 0 ${JOB_RETS[@]/#/+} )) |
368 |
+ |
369 |
+[[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ |
370 |
+einfo "Generation complete" |
371 |
+ |
372 |
+if ${LOCALE_ARCHIVE} ; then |
373 |
+ ebegin "Adding locales to archive" |
374 |
+ # The pattern ends with / on purpose: we don't care about files (like |
375 |
+ # locale-archive) in the locale subdir, and we definitely don't want to |
376 |
+ # delete them! |
377 |
+ for LOC in "${LOCALEDIR}"/*/; do |
378 |
+ LOC=${LOC%/} # Strip trailing /, since localedef doesn't like it |
379 |
+ x=$( |
380 |
+ "${DESTDIR}"usr/bin/localedef \ |
381 |
+ --add-to-archive "${LOC}" \ |
382 |
+ --replace \ |
383 |
+ --prefix "${DESTDIR%${EPREFIX}/}/" |
384 |
+ ret=$? |
385 |
+ if [[ -n ${output} ]] ; then |
386 |
+ echo "${x}" |
387 |
+ elif [[ ${ret} -ne 0 ]] ; then |
388 |
+ eerror "${disp}: ${x}" |
389 |
+ fi |
390 |
+ if [[ $ret -eq 0 ]]; then |
391 |
+ rm -r "${LOC}" |
392 |
+ fi |
393 |
+ exit ${ret} |
394 |
+ ) |
395 |
+ done |
396 |
+ eend $ret |
397 |
+fi |
398 |
+ |
399 |
+# Remove locales that existed but were not requested |
400 |
+if [[ -n ${UPDATE} ]] ; then |
401 |
+ # Ignore these pseudo locales |
402 |
+ existing_locales=${existing_locales/ C / } |
403 |
+ existing_locales=${existing_locales/ POSIX / } |
404 |
+ if [[ -n ${existing_locales// } ]] ; then |
405 |
+ if [[ -z ${KEEP} ]] ; then |
406 |
+ [[ ${QUIET} -eq 0 ]] && einfo "Scrubbing old locales:"${existing_locales} |
407 |
+ cd "${LOCALEDIR}" && rm -rf ${existing_locales} |
408 |
+ else |
409 |
+ [[ ${QUIET} -eq 0 ]] && einfo "Keeping old locales:"${existing_locales} |
410 |
+ fi |
411 |
+ fi |
412 |
+fi |
413 |
+ |
414 |
+exit ${ret} |
415 |
|
416 |
diff --git a/locale-gen.8 b/locale-gen.8 |
417 |
new file mode 100644 |
418 |
index 0000000..a194be7 |
419 |
--- /dev/null |
420 |
+++ b/locale-gen.8 |
421 |
@@ -0,0 +1,69 @@ |
422 |
+.TH "locale-gen" "8" "Aug 2007" "Gentoo" |
423 |
+.SH "NAME" |
424 |
+locale\-gen \- generate locales on the fly |
425 |
+.SH "DESCRIPTION" |
426 |
+The locale\-gen utility is used to manage locales on your system. Often times |
427 |
+it merely generates a user configurable list of locales, but it can be used to |
428 |
+generate a few locales on the fly as needed. |
429 |
+ |
430 |
+Normally all locales would be generated at build time, but this leads to waste |
431 |
+of disk and time as many users really just want a handful on their system. |
432 |
+.SH "OPTIONS" |
433 |
+.TP |
434 |
+\fB\-a\fR, \fB\-\-ask\fR |
435 |
+Ask before generating each locale |
436 |
+.TP |
437 |
+\fB\-A\fR, \fB\-\-all\fR |
438 |
+Generate all possible locales |
439 |
+.TP |
440 |
+\fB\-c\fR, \fB\-\-config\fR \fI<config>\fR |
441 |
+Use specified \fIconfig\fR file rather than default /etc/locale.gen |
442 |
+.TP |
443 |
+\fB\-d\fR, \fB\-\-destdir\fR \fI<dir>\fR |
444 |
+Look for locale definitions and store generated locale data in the specified |
445 |
+\fIdirectory\fR |
446 |
+.TP |
447 |
+\fB\-G\fR, \fB\-\-generate\fR \fI<locale>\fR |
448 |
+Only generate the specified \fIlocale\fR (implies \-\-keep \-\-update); |
449 |
+format of \fIlocale\fR matches a single line in the \fBlocale.gen\fR(5) |
450 |
+config file |
451 |
+.TP |
452 |
+\fB\-h\fR, \fB\-\-help\fR |
453 |
+Show the help output (imagine that) |
454 |
+.TP |
455 |
+\fB\-j\fR, \fB\-\-jobs\fR \fI<num>\fR |
456 |
+Generate the specified \fInumber\fR of locales in parallel |
457 |
+.TP |
458 |
+\fB\-k\fR, \fB\-\-keep\fR |
459 |
+Keep all existing locales even if they are not in the config file |
460 |
+.TP |
461 |
+\fB\-l\fR, \fB\-\-list\fR |
462 |
+List all the locales that we think should exist according to the config |
463 |
+.TP |
464 |
+\fB\-q\fR, \fB\-\-quiet\fR |
465 |
+Only spit out errors |
466 |
+.TP |
467 |
+\fB\-u\fR, \fB\-\-update\fR |
468 |
+Only generate locales that do not already exist (normally existing locales are regenerated) |
469 |
+.TP |
470 |
+\fB\-V\fR, \fB\-\-version\fR |
471 |
+Report the program version |
472 |
+.TP |
473 |
+\fB\-\-\fR |
474 |
+To pass custom options directly to the \fBlocaledef\fR utility, end the |
475 |
+\fBlocale\-gen\fR option list with \-\- and then everything after that will be |
476 |
+passed on through unmolested (the options \-c are passed by default) |
477 |
+.SH "AUTHORS" |
478 |
+.fi |
479 |
+Mike Frysinger <vapier@g.o> |
480 |
+.nf |
481 |
+.SH "REPORTING BUGS" |
482 |
+Please report bugs via http://bugs.gentoo.org/ |
483 |
+.SH "FILES" |
484 |
+\fB/etc/locale.gen\fR \- locale list |
485 |
+.SH "SEE ALSO" |
486 |
+.BR locale (1), |
487 |
+.BR localedef (1), |
488 |
+.BR locale (5), |
489 |
+.BR locale.gen (5), |
490 |
+.BR locale (7) |
491 |
|
492 |
diff --git a/locale.gen b/locale.gen |
493 |
new file mode 100644 |
494 |
index 0000000..0786f17 |
495 |
--- /dev/null |
496 |
+++ b/locale.gen |
497 |
@@ -0,0 +1,36 @@ |
498 |
+# /etc/locale.gen: list all of the locales you want to have on your system. |
499 |
+# See the locale.gen(5) man page for more details. |
500 |
+# |
501 |
+# The format of each line: |
502 |
+# <locale name> <charset> |
503 |
+# |
504 |
+# Where <locale name> starts with a name as found in /usr/share/i18n/locales/. |
505 |
+# It must be unique in the file as it is used as the key to locale variables. |
506 |
+# For non-default encodings, the <charset> is typically appended. |
507 |
+# |
508 |
+# Where <charset> is a charset located in /usr/share/i18n/charmaps/ (sans any |
509 |
+# suffix like ".gz"). |
510 |
+# |
511 |
+# All blank lines and lines starting with # are ignored. |
512 |
+# |
513 |
+# For the default list of supported combinations, see the file: |
514 |
+# /usr/share/i18n/SUPPORTED |
515 |
+# |
516 |
+# Whenever glibc is emerged, the locales listed here will be automatically |
517 |
+# rebuilt for you. After updating this file, you can simply run `locale-gen` |
518 |
+# yourself instead of re-emerging glibc. |
519 |
+ |
520 |
+#en_US ISO-8859-1 |
521 |
+#en_US.UTF-8 UTF-8 |
522 |
+#ja_JP.EUC-JP EUC-JP |
523 |
+#ja_JP.UTF-8 UTF-8 |
524 |
+#ja_JP EUC-JP |
525 |
+#en_HK ISO-8859-1 |
526 |
+#en_PH ISO-8859-1 |
527 |
+#de_DE ISO-8859-1 |
528 |
+#de_DE@euro ISO-8859-15 |
529 |
+#es_MX ISO-8859-1 |
530 |
+#fa_IR UTF-8 |
531 |
+#fr_FR ISO-8859-1 |
532 |
+#fr_FR@euro ISO-8859-15 |
533 |
+#it_IT ISO-8859-1 |
534 |
|
535 |
diff --git a/locale.gen.5 b/locale.gen.5 |
536 |
new file mode 100644 |
537 |
index 0000000..dbcc8c6 |
538 |
--- /dev/null |
539 |
+++ b/locale.gen.5 |
540 |
@@ -0,0 +1,77 @@ |
541 |
+.\" -*- nroff -*- |
542 |
+.\" Copyright (C) 2002, 2005 Free Software Foundation, Inc. |
543 |
+.\" |
544 |
+.\" This program is free software; you can redistribute it and/or modify |
545 |
+.\" it under the terms of the GNU General Public License as published by |
546 |
+.\" the Free Software Foundation; either version 2, or (at your option) |
547 |
+.\" any later version. |
548 |
+.\" |
549 |
+.\" This program is distributed in the hope that it will be useful, |
550 |
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
551 |
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
552 |
+.\" GNU General Public License for more details. |
553 |
+.\" |
554 |
+.\" You should have received a copy of the GNU General Public License |
555 |
+.\" along with this program; if not, write to the Free Software Foundation, |
556 |
+.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
557 |
+.TH locale.gen 5 "July 2005" "Debian GNU/Linux" |
558 |
+.SH "NAME" |
559 |
+locale.gen \- Configuration file for locale-gen |
560 |
+.SH "DESCRIPTION" |
561 |
+The file \fB/etc/locale.gen\fP lists the locales that are to be generated |
562 |
+by the \fBlocale-gen\fP command. |
563 |
+ |
564 |
+Each line is of the form: |
565 |
+ |
566 |
+<locale name> <charset> |
567 |
+ |
568 |
+Where <locale name> starts with a name as found in |
569 |
+.BR /usr/share/i18n/locales/ . |
570 |
+It must be unique in the file as it is used as the key to locale variables |
571 |
+(e.g. when you do `export LANG="<locale name>"`). For default encodings, |
572 |
+the <charset> is typically omitted, else it is appended with a "." separator. |
573 |
+ |
574 |
+Where <charset> is one of the character sets listed in |
575 |
+.B /usr/share/i18n/charmaps |
576 |
+(sans any suffix like ".gz"). It should use the same naming conventions too -- |
577 |
+all caps, and dashes/underscores included. e.g. Use "UTF-8", not "utf8". |
578 |
+ |
579 |
+The |
580 |
+.B locale-gen |
581 |
+command will generate all the locales, placing them in |
582 |
+\fB/usr/lib/locale\fP. |
583 |
+ |
584 |
+Comments start with the hash mark # and may only be on new lines. |
585 |
+.SH "OPTIONS" |
586 |
+Options start with #% (to preserve backwards compatibility). |
587 |
+ |
588 |
+# This enables the "foo" option. |
589 |
+.br |
590 |
+#%foo |
591 |
+.TP |
592 |
+.B no-locale-archive |
593 |
+Disable generation of the locale archive file and instead generate multiple |
594 |
+files/directories for each locale. This slows down runtime greatly (by having |
595 |
+multiple files spread out in the filesystem instead of a single binary file), |
596 |
+but it does mean build time is much faster (as you can generate in parallel). |
597 |
+ |
598 |
+You should not use this option. |
599 |
+.SH "EXAMPLES" |
600 |
+.nf |
601 |
+# Create a "en_US" locale using ISO-8859-1 encoding. |
602 |
+# When you set LANG=en_US or LANG=en_US.ISO-8859-1, this is used. |
603 |
+.B en_US ISO-8859-1 |
604 |
+ |
605 |
+# Create a "en_US" locale using UTF-8 encoding. |
606 |
+# When you set LANG=en_US.UTF-8, this is used. |
607 |
+.B en_US.UTF-8 UTF-8 |
608 |
+.fi |
609 |
+.SH "SEE ALSO" |
610 |
+.BR locale (1), |
611 |
+.BR localedef (1), |
612 |
+.BR locale-gen (8) |
613 |
+.SH "AUTHORS" |
614 |
+.nf |
615 |
+Alastair McKinstry <mckinstry@××××××××.org> |
616 |
+Mike Frysinger <vapier@g.o> |
617 |
+.fi |