zonetab1970 contains a table where each row stands for a timezone where
civil timestamps have agreed since 1970.

zonetab1970 is used by systemd in the timedatectl list-timezones
command that was broken without this data.

zonetab1970 is intended to be delivered with the complete data set from
tzdata package. Since PTXDIST offers the option to deliver timezones
only partially, the solution is to correct the file during installation.
Deselected timezone entries are removed from the file during INSTALL
step.

Signed-off-by: Gavin Schenk <g.sch...@eckelmann.de>
---
Changes since v2:
 - Fixed removed $(call touch) 
 - Fixed missing @ when installing zone1970.tab

Changes since v1:
 - Drop menuentry TIMEZONE_ZONETAB_1970 and install file always
 - Use suggested algorithm that is more compact and forks less processes
   ( Commented lines are not removed any more )

---
rules/host-tz-database.make | 2 +-
 rules/timezone.make         | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/rules/host-tz-database.make b/rules/host-tz-database.make
index fe4d36467..006060496 100644
--- a/rules/host-tz-database.make
+++ b/rules/host-tz-database.make
@@ -67,6 +67,6 @@ HOST_TZ_DATABASE_CONF_TOOL    := NO
 HOST_TZ_DATABASE_MAKE_OPT      := \
        zic TZDIR=/usr/share/zoneinfo CFLAGS=-DSTD_INSPIRED
 HOST_TZ_DATABASE_INSTALL_OPT   := \
-       posix_only TZDIR=/usr/share/zoneinfo
+       REDO=posix_only TZDIR=/usr/share/zoneinfo install
 
 # vim: syntax=make
diff --git a/rules/timezone.make b/rules/timezone.make
index c1fd3fbc3..794e0d61e 100644
--- a/rules/timezone.make
+++ b/rules/timezone.make
@@ -87,6 +87,11 @@ $(STATEDIR)/timezone.install:
        @for target in $(TIMEZONE-y); do \
                $(call add_zoneinfo, $$target, $(TIMEZONE_PKGDIR)/usr/share, 
$(PTXDIST_SYSROOT_HOST)/usr); \
        done
+# Fix entries in zonetab to match the selected PTXCONF_TIMEZONE_* options.
+       @grep "\($$(find $(TIMEZONE_PKGDIR)/usr/share/zoneinfo -type f -printf 
'%P\|')#\)" \
+               $(PTXDIST_SYSROOT_HOST)/usr/share/zoneinfo/zone1970.tab > \
+               $(TIMEZONE_PKGDIR)/usr/share/zoneinfo/zone1970.tab
+
        @$(call touch)
 
 # ----------------------------------------------------------------------------
@@ -116,6 +121,8 @@ ifneq ($(call remove_quotes,$(PTXCONF_TIMEZONE_LOCALTIME)),)
                /etc/localtime)
 endif
 
+       @$(call install_copy, timezone, 0, 0, 0644, -, 
/usr/share/zoneinfo/zone1970.tab)
+
        @$(call install_finish, timezone)
 
        @$(call touch)
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to 
ptxdist-requ...@pengutronix.de

Reply via email to