summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/archive-path.patch
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-03-01 18:26:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-02 17:06:24 +0100
commit796efea2d2359e6edbd5d4232895ef3a65959f5d (patch)
tree118c8a1b5b9d509c723c79621ab0d856f6a10ed7 /meta/recipes-core/glibc/glibc/archive-path.patch
parentf768fb3d2245b349af44aaa81d39a667adb9778c (diff)
downloadpoky-796efea2d2359e6edbd5d4232895ef3a65959f5d.tar.gz
cross-localedef-native: add way to specify which locale archive to write
localedef has no way to specify which locale archive to use, and the compile-time default isn't useful as it points to the work directory. Add support to read an environmental variable for the path, and don't fail to write a new locale archive. (From OE-Core rev: bf0f205a3c3714926649bd69db29e4df1c0ea112) (From OE-Core rev: 72ab0e7d49610f6ffcc99fa8723aeeaada852d88) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/glibc/archive-path.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/archive-path.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/archive-path.patch b/meta/recipes-core/glibc/glibc/archive-path.patch
new file mode 100644
index 0000000000..b0d3158cfe
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/archive-path.patch
@@ -0,0 +1,39 @@
1localedef --add-to-archive uses a hard-coded locale path which doesn't exist in
2normal use, and there's no way to pass an alternative filename.
3
4Add a fallback of $LOCALEARCHIVE from the environment, and allow creation of new locale archives that are not the system archive.
5
6Upstream-Status: Inappropriate (OE-specific)
7Signed-off-by: Ross Burton <ross.burton@intel.com>
8
9diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
10index ca332a34..6b7ba9b2 100644
11--- a/locale/programs/locarchive.c
12+++ b/locale/programs/locarchive.c
13@@ -569,10 +569,13 @@ open_archive (struct locarhandle *ah, bool readonly)
14 /* If ah has a non-NULL fname open that otherwise open the default. */
15 if (archivefname == NULL)
16 {
17- archivefname = default_fname;
18- if (output_prefix)
19- memcpy (default_fname, output_prefix, prefix_len);
20- strcpy (default_fname + prefix_len, ARCHIVE_NAME);
21+ archivefname = getenv("LOCALEARCHIVE");
22+ if (archivefname == NULL) {
23+ archivefname = default_fname;
24+ if (output_prefix)
25+ memcpy (default_fname, output_prefix, prefix_len);
26+ strcpy (default_fname + prefix_len, ARCHIVE_NAME);
27+ }
28 }
29
30 while (1)
31@@ -585,7 +588,7 @@ open_archive (struct locarhandle *ah, bool readonly)
32 the default locale archive we ignore the failure and
33 list an empty archive, otherwise we print an error
34 and exit. */
35- if (errno == ENOENT && archivefname == default_fname)
36+ if (errno == ENOENT)
37 {
38 if (readonly)
39 {