On 2024-12-11 05:09, Florian Weimer wrote:
* Brian Inglis via tz:
It's also not possible to detect on some POSIX-like systems (that use the IANA database) whether the system administrator has used a specific IANA identifier to configure the system. Applications only see the data blob describing the time zone behavior and (sometimes) abbreviations, and that doesn't include the identifier.
You should be able to figure it out whether using symlinks, hardlinks, or check sums of some kind:
$ head -v /etc/timezone; \ tail -vn1 /etc/localtime; echo; \ llgo /etc/localtime; echo; \ find /usr/share/zoneinfo/ -inum `stat -L -c%i /etc/localtime`; echo; \ cksum /etc/localtime; echo; \ find /usr/share/zoneinfo/ -size `cksum /etc/localtime | cut -d' ' -f2`c \ | xargs cksum ==> /etc/timezone <== America/Edmonton ==> /etc/localtime <== MST7MDT,M3.2.0,M11.1.0
Some systems (especially containers) have just /etc/localtime, and do not provide all those unused files under /usr/share/zoneinfo. Content-based matching fails for links and files that just happen to be the same (which would apply to Etc/Unknown, I expect).
So far there don't appear to be any - same content == same timezone e.g. Navajo == Mountain == US/Mountain == America/Shiprock == America/Denver; localtime == Canada/Mountain == America/Edmonton; et al.: including posix and right 1582 files 5.9MB become 992 links => 590 inodes 3.6MB. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry