void-packages/srcpkgs/lightdm/patches/musl-language.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

34 lines
951 B
Diff

--- a/liblightdm-gobject/language.c
+++ b/liblightdm-gobject/language.c
@@ -210,6 +210,7 @@
if (!priv->name)
{
+#if HAVE_LC_IDENTIFICATION
g_autofree gchar *locale = get_locale_name (priv->code);
if (locale)
{
@@ -224,6 +225,7 @@
setlocale (LC_ALL, current);
}
if (!priv->name)
+#endif
{
g_auto(GStrv) tokens = g_strsplit_set (priv->code, "_.@", 2);
priv->name = g_strdup (tokens[0]);
@@ -250,6 +252,7 @@
if (!priv->territory && strchr (priv->code, '_'))
{
+#if HAVE_LC_IDENTIFICATION
g_autofree gchar *locale = get_locale_name (priv->code);
if (locale)
{
@@ -264,6 +267,7 @@
setlocale (LC_ALL, current);
}
if (!priv->territory)
+#endif
{
g_auto(GStrv) tokens = g_strsplit_set (priv->code, "_.@", 3);
priv->territory = g_strdup (tokens[1]);