b1dca6
commit 97476447edff96e526daa1a22d6ed3665181ff93
b1dca6
Author: DJ Delorie <dj@redhat.com>
b1dca6
Date:   Wed Oct 23 17:52:26 2019 -0400
b1dca6
b1dca6
    Install charmaps uncompressed in testroot
b1dca6
    
b1dca6
    The testroot does not have a gunzip command, so the charmap files
b1dca6
    should not be installed gzipped else they cannot be used (and thus
b1dca6
    tested).  With this patch, installing with INSTALL_UNCOMPRESSED=yes
b1dca6
    installs uncompressed charmaps instead.
b1dca6
    
b1dca6
    Note that we must purge the $(symbolic_link_list) as it contains
b1dca6
    references to $(DESTDIR), which we change during the testroot
b1dca6
    installation.
b1dca6
    
b1dca6
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
b1dca6
b1dca6
diff --git a/Makefile b/Makefile
b1dca6
index 3748d6f7cfb6223b..6d73241bbc811c13 100644
b1dca6
--- a/Makefile
b1dca6
+++ b/Makefile
b1dca6
@@ -398,8 +398,15 @@ ifeq ($(run-built-tests),yes)
b1dca6
 	    $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
b1dca6
 	  done
b1dca6
 endif
b1dca6
+	# $(symbolic-link-list) is a file that encodes $(DESTDIR) so we
b1dca6
+	# have to purge it
b1dca6
+	rm -f $(symbolic-link-list)
b1dca6
+	# Setting INSTALL_UNCOMPRESSED causes localedata/Makefile to
b1dca6
+	# install the charmaps uncompressed, as the testroot does not
b1dca6
+	# provide a gunzip program.
b1dca6
 	$(MAKE) install DESTDIR=$(objpfx)testroot.pristine \
b1dca6
-	  subdirs='$(sorted-subdirs)'
b1dca6
+	  INSTALL_UNCOMPRESSED=yes subdirs='$(sorted-subdirs)'
b1dca6
+	rm -f $(symbolic-link-list)
b1dca6
 	touch $(objpfx)testroot.pristine/install.stamp
b1dca6
 
b1dca6
 tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
b1dca6
diff --git a/localedata/Makefile b/localedata/Makefile
b1dca6
index 0fed95dcae6a9183..14fcc37fed21e740 100644
b1dca6
--- a/localedata/Makefile
b1dca6
+++ b/localedata/Makefile
b1dca6
@@ -167,9 +167,17 @@ endif
b1dca6
 endif
b1dca6
 
b1dca6
 # Files to install.
b1dca6
+ifeq ($(INSTALL_UNCOMPRESSED),yes)
b1dca6
+# This option is for testing inside the testroot container, as the
b1dca6
+# container does not include a working gunzip program.
b1dca6
+install-others := $(addprefix $(inst_i18ndir)/, \
b1dca6
+			      $(charmaps) \
b1dca6
+			      $(locales))
b1dca6
+else
b1dca6
 install-others := $(addprefix $(inst_i18ndir)/, \
b1dca6
 			      $(addsuffix .gz, $(charmaps)) \
b1dca6
 			      $(locales))
b1dca6
+endif
b1dca6
 
b1dca6
 tests: $(objdir)/iconvdata/gconv-modules
b1dca6
 
b1dca6
@@ -282,12 +290,22 @@ endif
b1dca6
 
b1dca6
 include ../Rules
b1dca6
 
b1dca6
+ifeq ($(INSTALL_UNCOMPRESSED),yes)
b1dca6
+# Install the charmap files as-is.  This option is for testing inside
b1dca6
+# the testroot container, as the container does not include a working
b1dca6
+# gunzip program.
b1dca6
+$(inst_i18ndir)/charmaps/%: charmaps/% $(+force)
b1dca6
+	$(make-target-directory)
b1dca6
+	rm -f $@
b1dca6
+	$(INSTALL_DATA) $< $@
b1dca6
+else
b1dca6
 # Install the charmap files in gzipped format.
b1dca6
 $(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
b1dca6
 	$(make-target-directory)
b1dca6
 	rm -f $(@:.gz=) $@
b1dca6
 	$(INSTALL_DATA) $< $(@:.gz=)
b1dca6
 	gzip -9n $(@:.gz=)
b1dca6
+endif
b1dca6
 
b1dca6
 # Install the locale source files in the appropriate directory.
b1dca6
 $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)