all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob b6433993709c5bdeb5906eed6e62d7481d442671 1502 bytes (raw)
name: gnu/packages/patches/glibc-versioned-locpath.patch 	 # note: path name is non-authoritative(*)

 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
 
The format of locale data can be incompatible between libc versions, and
loading incompatible data can lead to 'setlocale' returning EINVAL at best
or triggering an assertion failure at worst.  See
https://lists.gnu.org/archive/html/guix-devel/2015-09/msg00717.html
for background information.

To address that, this patch changes libc to look for locale data in
version-specific sub-directories.  So, if LOCPATH=/foo:/bar, locale data
is searched for in /foo/X.Y and /bar/X.Y, where X.Y is the libc version
number.

That way, a single 'LOCPATH' setting can work even if different libc versions
coexist on the system.

--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -25,6 +25,10 @@
 # include <config.h>
 #endif
 
+#ifdef _LIBC
+# include <version.h>
+#endif
+
 #include <string.h>
 
 #if defined _LIBC || defined HAVE_ARGZ_H
@@ -164,6 +168,9 @@ _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
 
   /* Allocate room for the full file name.  */
   abs_filename = (char *) malloc (dirlist_len
+#ifdef _LIBC
+				  + strlen (VERSION) + 1
+#endif
 				  + strlen (language)
 				  + ((mask & XPG_TERRITORY) != 0
 				     ? strlen (territory) + 1 : 0)
@@ -185,6 +192,10 @@ _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
   memcpy (abs_filename, dirlist, dirlist_len);
   __argz_stringify (abs_filename, dirlist_len, ':');
   cp = abs_filename + (dirlist_len - 1);
+#ifdef _LIBC
+  *cp++ = '/';
+  cp = stpcpy (cp, VERSION);
+#endif
   *cp++ = '/';
   cp = stpcpy (cp, language);

debug log:

solving b643399 ...
found b643399 in https://yhetil.org/guix/1443736716-8578-3-git-send-email-ludo@gnu.org/

applying [1/1] https://yhetil.org/guix/1443736716-8578-3-git-send-email-ludo@gnu.org/
diff --git a/gnu/packages/patches/glibc-versioned-locpath.patch b/gnu/packages/patches/glibc-versioned-locpath.patch
new file mode 100644
index 0000000..b643399

1:26: trailing whitespace.
 
1:32: trailing whitespace.
 
1:35: trailing whitespace.
 
1:41: space before tab in indent.
 				  + strlen (language)
1:42: space before tab in indent.
 				  + ((mask & XPG_TERRITORY) != 0
Checking patch gnu/packages/patches/glibc-versioned-locpath.patch...
Applied patch gnu/packages/patches/glibc-versioned-locpath.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 b6433993709c5bdeb5906eed6e62d7481d442671	gnu/packages/patches/glibc-versioned-locpath.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.