I see this message in logs: LOG: postinst You do not have TIMEZONE set in /etc/timezone. Skipping auto-update of /etc/localtime. I would show this message only if systemd is not booted. That can be done inheritting systemd.eclass and using systemd_is_booted
unfortunately systemd.eclass depends on pkg-config which means we don't want it
Pacho: Why do we care if systemd is booted? There is technically nothing that prevents the user from keeping /etc/timezone as a regular file while running systemd. It would be nice to move the symlink check up to the top of pkg_postinst though. Something like this (ignoring whitespace): --- a/sys-libs/timezone-data/timezone-data-2015f.ebuild +++ b/sys-libs/timezone-data/timezone-data-2015f.ebuild @@ -106,6 +106,9 @@ pkg_config() { # make sure the /etc/localtime file does not get stale #127899 local tz src="${EROOT}etc/timezone" etc_lt="${EROOT}etc/localtime" + if [[ -L ${etc_lt} ]]; then + einfo "Skipping symlinked ${etc_lt}" + else tz=$(get_TIMEZONE) || return 0 if [[ ${tz} == "FOOKABLOIE" ]] ; then elog "You do not have TIMEZONE set in ${src}." @@ -130,9 +133,7 @@ pkg_config() { elog "Your ${etc_lt} has been reset to Factory; enjoy!" tz="Factory" fi - if [[ -L ${etc_lt} ]]; then - einfo "Skipping symlinked ${etc_lt}" - else + einfo "Updating ${etc_lt} with ${EROOT}usr/share/zoneinfo/${tz}" cp -f "${EROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}" fi
(In reply to Mike Gilbert from comment #2) i'm fine with short-circuiting the logic when /etc/localtime is a symlink, although i wouldn't write it like that. pushed this instead: http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59491564457b11aa864a36444797e9c9dfb59047
(In reply to Mike Gilbert from comment #2) > Pacho: Why do we care if systemd is booted? There is technically nothing > that prevents the user from keeping /etc/timezone as a regular file while > running systemd. > Well... I wonder about the many elog messages that are still saved telling systemd users to play with conf.d files, init.d and many stuff that they can surely ignore :( Anyway, thanks a lot for handling it in a way it makes happy all the people :)