glibc40/glibc-2.34-allow-zstd-compressed-locales.patch
Alexander Stefanov 57fdafec17 2.36
2022-09-20 14:42:45 +00:00

64 lines
2.2 KiB
Diff
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

diff -up glibc-2.34/localedata/Makefile.omv~ glibc-2.34/localedata/Makefile
--- glibc-2.34/localedata/Makefile.omv~ 2022-01-06 18:06:45.391538999 +0100
+++ glibc-2.34/localedata/Makefile 2022-01-06 18:08:26.399970061 +0100
@@ -179,7 +179,7 @@ install-others := $(addprefix $(inst_i18
$(locales))
else
install-others := $(addprefix $(inst_i18ndir)/, \
- $(addsuffix .gz, $(charmaps)) \
+ $(addsuffix .zst, $(charmaps)) \
$(locales))
endif
@@ -308,12 +308,12 @@ $(inst_i18ndir)/charmaps/%: charmaps/% $
rm -f $@
$(INSTALL_DATA) $< $@
else
-# Install the charmap files in gzipped format.
-$(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
+# Install the charmap files in zstd compressed format.
+$(inst_i18ndir)/charmaps/%.zst: charmaps/% $(+force)
$(make-target-directory)
- rm -f $(@:.gz=) $@
- $(INSTALL_DATA) $< $(@:.gz=)
- gzip -9n $(@:.gz=)
+ rm -f $(@:.zst=) $@
+ $(INSTALL_DATA) $< $(@:.zst=)
+ zstd --ultra -22 --rm $(@:.zst=)
endif
# Install the locale source files in the appropriate directory.
diff -up glibc-2.34/locale/programs/charmap-dir.c.omv~ glibc-2.34/locale/programs/charmap-dir.c
--- glibc-2.34/locale/programs/charmap-dir.c.omv~ 2022-01-06 17:51:10.014329749 +0100
+++ glibc-2.34/locale/programs/charmap-dir.c 2022-01-06 17:52:34.351961655 +0100
@@ -224,12 +224,17 @@ charmap_open (const char *directory, con
if (stream != NULL)
return stream;
- memcpy (p, ".gz", 4);
+ memcpy (p, ".zst\0", 5);
+ stream = fopen_uncompressed (pathname, "zstd");
+ if (stream != NULL)
+ return stream;
+
+ memcpy (p, ".gz\0", 4);
stream = fopen_uncompressed (pathname, "gzip");
if (stream != NULL)
return stream;
- memcpy (p, ".bz2", 5);
+ memcpy (p, ".bz2\0", 5);
stream = fopen_uncompressed (pathname, "bzip2");
if (stream != NULL)
return stream;
diff -up glibc-2.34/Makerules.omv~ glibc-2.34/Makerules
--- glibc-2.34/Makerules.omv~ 2022-01-06 18:05:12.594131276 +0100
+++ glibc-2.34/Makerules 2022-01-06 18:06:40.799519105 +0100
@@ -1410,6 +1410,7 @@ echo-headers:
%.bz2: %; bzip2 -9vk $<
%.gz: %; gzip -9vnc $< > $@.new && mv -f $@.new $@
%.xz: %; xz -9evk $<
+%.zst: %; zstd --ultra -22 --rm $<
# Common cleaning targets.