recipes: db/tzdb: Ensure copy of the time zone database
[dragora.git] / recipes / db / tzdb / post-install
blob3fadc781fda5e1fb640b08a217b983224d1a837e
2 # Copy/update time zone database to the /etc hierarchy
4 cp -Rpf "${packagedir}/${name}"/etc/zoneinfo* etc/
6 # Set default zone info file, default points to 'UTC'
8 if test -r etc/zoneinfo/UTC
9 then
10     if test -L etc/localtime && test ! -e etc/localtime
11     then
12         echo "etc/localtime is a dangling symlink, trying to recreate it" 1>&2
13         ln -sf zoneinfo/UTC etc/localtime
14     elif test ! -e etc/localtime
15     then
16         ln -s zoneinfo/UTC etc/localtime
17     fi
20 if test ! -e etc/localtime
21 then
22     echo "Setting default time zone to UTC (etc/localtime -> zoneinfo/UTC) ..."
23     ln -sf zoneinfo/UTC etc/localtime
26 # Re-create symlink for "zoneinfo-posix" directory
28 rm -f etc/zoneinfo-posix
29 cd etc && ln -sf zoneinfo zoneinfo-posix