1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
From 5a6f019ded549faaf42478f6f96428dc7c20606e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 3 Aug 2018 09:42:06 -0700
Subject: [PATCH 29/30] localedef --add-to-archive uses a hard-coded locale
path
it doesn't exist in normal use, and there's no way to pass an
alternative filename.
Add a fallback of $LOCALEARCHIVE from the environment, and allow
creation of new locale archives that are not the system archive.
Upstream-Status: Inappropriate (OE-specific)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
locale/programs/locarchive.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index ca332a345f..6b7ba9b2e3 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -569,10 +569,13 @@ open_archive (struct locarhandle *ah, bool readonly)
/* If ah has a non-NULL fname open that otherwise open the default. */
if (archivefname == NULL)
{
- archivefname = default_fname;
- if (output_prefix)
- memcpy (default_fname, output_prefix, prefix_len);
- strcpy (default_fname + prefix_len, ARCHIVE_NAME);
+ archivefname = getenv("LOCALEARCHIVE");
+ if (archivefname == NULL) {
+ archivefname = default_fname;
+ if (output_prefix)
+ memcpy (default_fname, output_prefix, prefix_len);
+ strcpy (default_fname + prefix_len, ARCHIVE_NAME);
+ }
}
while (1)
@@ -585,7 +588,7 @@ open_archive (struct locarhandle *ah, bool readonly)
the default locale archive we ignore the failure and
list an empty archive, otherwise we print an error
and exit. */
- if (errno == ENOENT && archivefname == default_fname)
+ if (errno == ENOENT)
{
if (readonly)
{
--
2.18.0
|