]> code.ossystems Code Review - openembedded-core.git/commitdiff
base-files: Don't export TZ if /etc/TZ exists
authorRichard Tollerton <rich.tollerton@ni.com>
Wed, 23 Jul 2014 22:29:28 +0000 (17:29 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 25 Jul 2014 14:33:33 +0000 (15:33 +0100)
While glibc/eglibc looks for the time zone in /etc/localtime, other libc
alternatives (e.g. uclibc) may look for it in /etc/TZ.  If /etc/TZ
exists, don't fall back to setting TZ to "UTC" in /etc/profile.

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/base-files/base-files/profile

index 8eeaac36937eacb73b7aa758a76e633a6b79cd1e..0b2d9d79e51a4c6f304585a6086d80aee779e987 100644 (file)
@@ -5,7 +5,7 @@ PATH="/usr/local/bin:/usr/bin:/bin"
 EDITOR="/bin/vi"                       # needed for packages like cron
 test -z "$TERM" && TERM="vt100"        # Basic terminal capab. For screen etc.
 
-if [ ! -e /etc/localtime ]; then
+if [ ! -e /etc/localtime -a ! -e /etc/TZ ]; then
        TZ="UTC"                # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html 
                                # for an explanation of how to set this to your local timezone.
        export TZ