summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
new file mode 100644
index 0000000000..7cbf6811a1
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
@@ -0,0 +1,84 @@
1From c5fd8a3d336b8288f631fb6b6dd85f9d1076f25b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Aug 2018 09:42:06 -0700
4Subject: [PATCH 23/29] localedef --add-to-archive uses a hard-coded locale
5 path
6
7it doesn't exist in normal use, and there's no way to pass an
8alternative filename.
9
10Add a fallback of $LOCALEARCHIVE from the environment, and allow
11creation of new locale archives that are not the system archive.
12
13Upstream-Status: Inappropriate (OE-specific)
14
15Signed-off-by: Ross Burton <ross.burton@intel.com>
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 locale/programs/locarchive.c | 35 +++++++++++++++++++++++++----------
19 1 file changed, 25 insertions(+), 10 deletions(-)
20
21diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
22index dccaf04e3b..ae0b7fe155 100644
23--- a/locale/programs/locarchive.c
24+++ b/locale/programs/locarchive.c
25@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
26 struct namehashent *oldnamehashtab;
27 struct locarhandle new_ah;
28 size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
29- char archivefname[prefix_len + sizeof (ARCHIVE_NAME)];
30- char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1];
31+ char *archivefname;
32+ char *fname;
33+ char *envarchive = getenv("LOCALEARCHIVE");
34
35- if (output_prefix)
36- memcpy (archivefname, output_prefix, prefix_len);
37- strcpy (archivefname + prefix_len, ARCHIVE_NAME);
38+ if (envarchive != NULL)
39+ {
40+ archivefname = xmalloc(strlen(envarchive) + 1);
41+ fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX"));
42+ strcpy (archivefname, envarchive);
43+ }
44+ else
45+ {
46+ archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME));
47+ fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1);
48+ if (output_prefix)
49+ memcpy (archivefname, output_prefix, prefix_len);
50+ strcpy (archivefname + prefix_len, ARCHIVE_NAME);
51+ }
52 strcpy (stpcpy (fname, archivefname), ".XXXXXX");
53
54 /* Not all of the old file has to be mapped. Change this now this
55@@ -569,10 +581,13 @@ open_archive (struct locarhandle *ah, bool readonly)
56 /* If ah has a non-NULL fname open that otherwise open the default. */
57 if (archivefname == NULL)
58 {
59- archivefname = default_fname;
60- if (output_prefix)
61- memcpy (default_fname, output_prefix, prefix_len);
62- strcpy (default_fname + prefix_len, ARCHIVE_NAME);
63+ archivefname = getenv("LOCALEARCHIVE");
64+ if (archivefname == NULL) {
65+ archivefname = default_fname;
66+ if (output_prefix)
67+ memcpy (default_fname, output_prefix, prefix_len);
68+ strcpy (default_fname + prefix_len, ARCHIVE_NAME);
69+ }
70 }
71
72 while (1)
73@@ -585,7 +600,7 @@ open_archive (struct locarhandle *ah, bool readonly)
74 the default locale archive we ignore the failure and
75 list an empty archive, otherwise we print an error
76 and exit. */
77- if (errno == ENOENT && archivefname == default_fname)
78+ if (errno == ENOENT)
79 {
80 if (readonly)
81 {
82--
832.27.0
84