Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 949812

Summary: sys-libs/timezone-data: remove /etc/timezone?
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: systemd
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/40609
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2025-02-15 16:38:40 UTC
Apparently Debian has deprecated /etc/timezone, as timedatectl isn't updating it:

https://salsa.debian.org/glibc-team/tzdata/-/commit/c071fbc167ad306394b576879d515e6ecbe5a734

I suppose we should also look into removing the file, as random tools want to wrongly depend on it being correct.  In fact, libcxx is considering starting to rely on that file right now [1], so better get rid of it before more people make the mistake.

[1] https://github.com/llvm/llvm-project/issues/105634#issuecomment-2660976683
Comment 1 Mike Gilbert gentoo-dev 2025-02-16 01:35:03 UTC
The ebuild already removes /etc/timezone when creating /etc/localtime as a symlink. We don't remove it if /etc/localtime exists as a regular file.

I think the next logical step would be to forcibly convert /etc/localtime from a regular file to a symlink when timezone-data is upgraded.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2025-02-16 02:44:28 UTC
Perhaps it should also remove it (or at least verbosely warn about it) when /etc/localtime is a symlink already.
Comment 3 Larry the Git Cow gentoo-dev 2025-02-17 21:26:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=311832fc268b9b62bd996fafdcbde0eafd3ab817

commit 311832fc268b9b62bd996fafdcbde0eafd3ab817
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2025-02-17 02:02:24 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2025-02-17 21:24:07 +0000

    sys-libs/timezone-data: remove /etc/timezone if localtime is a symlink
    
    Closes: https://bugs.gentoo.org/949812
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-libs/timezone-data/timezone-data-2025a.ebuild | 4 ++++
 1 file changed, 4 insertions(+)