[v1] Install charmaps uncompressed in testroot
Commit Message
From e3027d399f52f1a8bb74ef2fa3c360b396539342 Mon Sep 17 00:00:00 2001
From: DJ Delorie <dj@redhat.com>
Date: Wed, 23 Oct 2019 17:52:26 -0400
Subject: Install charmaps uncompressed in testroot
The testroot does not have a gunzip command, so the charmap files
should not be installed gzipped else they cannot be used (and thus
tested). With this patch, installing with INSTALL_UNCOMPRESSED=yes
installs uncompressed charmaps instead.
Note that we must purge the $(symbolic_link_list) as it contains
references to $(DESTDIR), which we change during the testroot
installation.
Comments
On 10/23/19 6:36 PM, DJ Delorie wrote:
> From e3027d399f52f1a8bb74ef2fa3c360b396539342 Mon Sep 17 00:00:00 2001
> From: DJ Delorie <dj@redhat.com>
> Date: Wed, 23 Oct 2019 17:52:26 -0400
> Subject: Install charmaps uncompressed in testroot
>
> The testroot does not have a gunzip command, so the charmap files
> should not be installed gzipped else they cannot be used (and thus
> tested). With this patch, installing with INSTALL_UNCOMPRESSED=yes
> installs uncompressed charmaps instead.
This is a good compromise between something we can use and something
we can't use for localedef testing (and I have a follow-on patch to
test localedef).
> Note that we must purge the $(symbolic_link_list) as it contains
> references to $(DESTDIR), which we change during the testroot
> installation.
Please post v2 with new comments.
> diff --git a/Makefile b/Makefile
> index 0711b9725d..586437911a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -580,8 +580,10 @@ ifeq ($(run-built-tests),yes)
> $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
> done
> endif
> + rm -f $(symbolic_link_list)
> $(MAKE) install DESTDIR=$(objpfx)testroot.pristine \
> - subdirs='$(sorted-subdirs)'
> + INSTALL_UNCOMPRESSED=yes subdirs='$(sorted-subdirs)'
> + rm -f $(symbolic_link_list)
Needs a comment explaining why we use INSTALL_UNCOMPRESSED=yes, talk
about that compressed character maps can need gzip/bzip2 but that we
can't easily find target gzip/bzip2 binaries so to avoid this dependency
we install uncompressed character maps.
> touch $(objpfx)testroot.pristine/install.stamp
>
> tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
> diff --git a/localedata/Makefile b/localedata/Makefile
> index 33e473a883..6c73e26df2 100644
> --- a/localedata/Makefile
> +++ b/localedata/Makefile
> @@ -167,9 +167,15 @@ endif
> endif
>
> # Files to install.
Needs a comment explaining what INSTALL_UNCOMPRESSED does.
> +ifeq ($(INSTALL_UNCOMPRESSED),yes)
> +install-others := $(addprefix $(inst_i18ndir)/, \
> + $(charmaps) \
> + $(locales))
> +else
> install-others := $(addprefix $(inst_i18ndir)/, \
> $(addsuffix .gz, $(charmaps)) \
> $(locales))
> +endif
>
> tests: $(objdir)/iconvdata/gconv-modules
>
> @@ -283,12 +289,20 @@ endif
>
> include ../Rules
>
> +ifeq ($(INSTALL_UNCOMPRESSED),yes)
> +# Install the charmap files as-is.
Please expand comment to reference that this is being used by test-in-container
to install character maps without compression. This way anyone reviewing
this can immediately go find the testroot install code.
> +$(inst_i18ndir)/charmaps/%: charmaps/% $(+force)
> + $(make-target-directory)
> + rm -f $@
> + $(INSTALL_DATA) $< $@
> +else
> # Install the charmap files in gzipped format.
> $(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
> $(make-target-directory)
> rm -f $(@:.gz=) $@
> $(INSTALL_DATA) $< $(@:.gz=)
> gzip -9n $(@:.gz=)
> +endif
>
> # Install the locale source files in the appropriate directory.
> $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
>
@@ -580,8 +580,10 @@ ifeq ($(run-built-tests),yes)
$(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
done
endif
+ rm -f $(symbolic_link_list)
$(MAKE) install DESTDIR=$(objpfx)testroot.pristine \
- subdirs='$(sorted-subdirs)'
+ INSTALL_UNCOMPRESSED=yes subdirs='$(sorted-subdirs)'
+ rm -f $(symbolic_link_list)
touch $(objpfx)testroot.pristine/install.stamp
tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
@@ -167,9 +167,15 @@ endif
endif
# Files to install.
+ifeq ($(INSTALL_UNCOMPRESSED),yes)
+install-others := $(addprefix $(inst_i18ndir)/, \
+ $(charmaps) \
+ $(locales))
+else
install-others := $(addprefix $(inst_i18ndir)/, \
$(addsuffix .gz, $(charmaps)) \
$(locales))
+endif
tests: $(objdir)/iconvdata/gconv-modules
@@ -283,12 +289,20 @@ endif
include ../Rules
+ifeq ($(INSTALL_UNCOMPRESSED),yes)
+# Install the charmap files as-is.
+$(inst_i18ndir)/charmaps/%: charmaps/% $(+force)
+ $(make-target-directory)
+ rm -f $@
+ $(INSTALL_DATA) $< $@
+else
# Install the charmap files in gzipped format.
$(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
$(make-target-directory)
rm -f $(@:.gz=) $@
$(INSTALL_DATA) $< $(@:.gz=)
gzip -9n $(@:.gz=)
+endif
# Install the locale source files in the appropriate directory.
$(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)