package/tz: fix incorrect timezone setting for uclibc
authorScott Fan <fancp2007@gmail.com>
Fri, 31 Jul 2015 06:25:35 +0000 (14:25 +0800)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 6 Aug 2015 07:12:18 +0000 (09:12 +0200)
According to the doc file from <uclibc-src>/docs/
Glibc_vs_uClibc_Differences.txt, the uclibc library read the
TZ environment variable, or the /etc/TZ file; the /etc/TZ file
should be a single line, ending with a newline, containing the
TZ setting.  For example: echo CST6CDT > /etc/TZ

Whereas the tzdump cmd would output two lines like this:
  # Asia/Shanghai
  CST-8

This make the uclibc could not read the correct TZ setting, therefore
e.g. the 'busybox date' cmd always show the UTC timezone.

This fix remove the redundant first line from the tzdump output.

Signed-off-by: Scott Fan <fancp2007@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/tz/tz.mk

index 349d73f7f2d34a85b3fe9f1090c673e3a76c8d35..7a756eb5d8f9e06e4cb8b699244bf4081586a7f9 100644 (file)
@@ -14,7 +14,7 @@ define TZ_BUILD_CMDS
        (cd $(HOST_DIR)/usr/share/zoneinfo/posix/;                 \
                for i in $$(find . -type f); do                    \
                        mkdir -p $(@D)/output/$$(dirname $$i);         \
-                       $(TZDUMP) -p . -q $${i#./} > $(@D)/output/$$i; \
+                       $(TZDUMP) -p . -q $${i#./} | sed '1d' > $(@D)/output/$$i; \
                done                                               \
        )
 endef