Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 511474 - sys-libs/timezone-data: elog message is not needed when systemd is used
Summary: sys-libs/timezone-data: elog message is not needed when systemd is used
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-25 16:45 UTC by Pacho Ramos
Modified: 2015-08-31 19:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2014-05-25 16:45:07 UTC
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
Comment 1 SpanKY gentoo-dev 2015-08-21 21:40:16 UTC
unfortunately systemd.eclass depends on pkg-config which means we don't want it
Comment 2 Mike Gilbert gentoo-dev 2015-08-21 22:41:09 UTC
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
Comment 3 SpanKY gentoo-dev 2015-08-22 00:18:39 UTC
(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
Comment 4 Pacho Ramos gentoo-dev 2015-08-31 19:19:21 UTC
(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 :)