On Wed, Oct 1, 2014 at 1:08 PM, akhiezer <[email protected]> wrote:
> Do you mean that it's not easy for progs to know which original file
> had been copied over to /etc/localtime ? If yes, then ref e.g.
> '/etc/localtime-copied-from' symlink below.

As proposed by soemone online, one way to map copied file is to
compare md5 checksum. However the result is not a single entry:

$ md5sum /etc/localtime
410c65079e6d14f4eedf50c19bd073f8  /etc/localtime

$ find /usr/share/zoneinfo -type f | xargs md5sum | grep
410c65079e6d14f4eedf50c19bd073f8
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/GB
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/GB
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/GB-Eire
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/Europe/Belfast
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/Europe/Guernsey
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/Europe/Jersey
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/Europe/Isle_of_Man
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/posix/Europe/London
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/GB-Eire
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/Europe/Belfast
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/Europe/Guernsey
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/Europe/Jersey
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/Europe/Isle_of_Man
410c65079e6d14f4eedf50c19bd073f8  /usr/share/zoneinfo/Europe/London

Another example:
$ cp  /usr/share/zoneinfo/Europe/Oslo  /etc/localtime
$ md5sum /etc/localtime
bf4f10e6703e5142a7c4d23dc4cd7ef0  /etc/localtime

$ find /usr/share/zoneinfo -type f | xargs md5sum | grep
bf4f10e6703e5142a7c4d23dc4cd7ef0
bf4f10e6703e5142a7c4d23dc4cd7ef0  /usr/share/zoneinfo/Atlantic/Jan_Mayen
bf4f10e6703e5142a7c4d23dc4cd7ef0  /usr/share/zoneinfo/posix/Atlantic/Jan_Mayen
bf4f10e6703e5142a7c4d23dc4cd7ef0  /usr/share/zoneinfo/posix/Arctic/Longyearbyen
bf4f10e6703e5142a7c4d23dc4cd7ef0  /usr/share/zoneinfo/posix/Europe/Oslo
bf4f10e6703e5142a7c4d23dc4cd7ef0  /usr/share/zoneinfo/Arctic/Longyearbyen
bf4f10e6703e5142a7c4d23dc4cd7ef0  /usr/share/zoneinfo/Europe/Oslo

How application (user interface/c/bash/etc) uniquely and reliably
present a location set by user earlier, if /etc/localtime is a copy
instead of sym link?

- On Debian-based systems (including Ubuntu), /etc/timezone contains
the right answer.
- On some Redhat-based systems (CentOS, RHEL, Fedora), /etc/localtime
is a symlink to (for example) /usr/share/zoneinfo/Europe/London.
- OpenBSD seems to use the same scheme as RedHat.

As I see it, several major distros provide a solution to this problem,
but LFS does not.
A few additions lines would help others who will end up with this
problem at some point later.

Cheers,
Alexey
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to