Skip to contentSkip to conversation

package/tz: fix incorrect timezone setting for uclibc

PATCH New Scott Fan 3 participants 4 messages Jul 31, 2015 – Aug 6, 2015

lore
Share & tools
lore

Scott Fan

author
#0 lore raw

PATCH 1/1 package/tz: fix incorrect timezone setting for uclibc

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.

---
 package/tz/tz.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/tz/tz.mk +1 -1
index 349d73f..7a756eb 100644
@@ -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
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 package/tz: fix incorrect timezone setting for uclibc

Scott, All,

On 2015-07-31 14:25 +0800, Scott Fan spake thusly:

Quoted 10 lines

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

Quoted 6 lines

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.

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 package/tz/tz.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/tz/tz.mk +1 -1
index 349d73f..7a756eb 100644
@@ -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
Signature · 6 lines
2.5.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
author
#2 lore raw

PATCH 1/1 package/tz: fix incorrect timezone setting for uclibc

Yann, All,

Is this patch ok?

Thanks.

Regards,
Scott Fan

Quoted 64 lines · Yann E. MORIN

Scott, All,

On 2015-07-31 14:25 +0800, Scott Fan spake thusly:

Quoted 10 lines

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

Quoted 6 lines

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.

Regards,
Yann E. MORIN.

Quoted 9 lines
---
 package/tz/tz.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/tz/tz.mk +0 -0
index 349d73f..7a756eb 100644

package/tz/tz.mk define TZ_BUILD_CMDS · line 17

Quoted 5 lines
package/tz/tz.mk +1 -1
@@ -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; \

Quoted 10 lines
package/tz/tz.mk +0 -1
              done                                               \
      )
 endef
--

2.5.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--

.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
     |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There
is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
 conspiracy.  |
Quoted 2 lines

'------------------------------^-------^------------------^--------------------'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150806/4bab6d37/attachment.html>

#3 lore raw

PATCH 1/1 package/tz: fix incorrect timezone setting for uclibc

In reply to Scott Fan

Dear Scott Fan,

Quoted 13 lines · Scott Fan

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.

Quoted 6 lines

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

---
 package/tz/tz.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com