A friend of mine and I were just wondering why emerge --config timezone-data didn't update his /etc/localtime. It didn't print any errors, so we were assuming it ran correctly. The issue was that his /etc/timezone was existing, but accidentally empty. The code path taken is this: get_TIMEZONE() { ... [[ -z ${tz} ]] && return 1 || echo "${tz}" } ... tz=$(get_TIMEZONE) || return 0 => Silently returns. I assume checking for an empty /etc/timezone file was on purpose, but this behaviour was not intended. I suppose a warning would be appropriate. In fact, there are a few checks directly after that which aren't reached in this case however. Can't we just remove the [[ -z ${tz} ]] check?
it's this way on purpose. a file that exists but is empty is the same as having a file where the var is set to nothing. e.g. the old code had: /etc/conf.d/clock: TIMEZONE="" https://sources.gentoo.org/sys-libs/timezone-data/timezone-data-2007c.ebuild?r1=1.9&r2=1.10 hence we also support setting /etc/timezone to an empty file to disable the logic. this is an explicit knob for the admin. since it's explicitly supported, a warning is inappropriate: the system state is not in a bad state. it also would lead to pkg_postinst elog spam which we explicitly avoid. we could add an `einfo` in there to say it's returning as that would be swallowed by the PM during normal runs.
(In reply to SpanKY from comment #1) > [..] > hence we also support setting /etc/timezone to an empty file to disable the > logic. this is an explicit knob for the admin. Ok, sounds reasonable. > we could add an `einfo` in there to say it's returning as that would be > swallowed by the PM during normal runs. Ok, good. Thanks.
this should satisfy your request: http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2178d2c8957b99e73d120472e06d751a5e80ea1d