aboutsummaryrefslogtreecommitdiffstats
path: root/packages/all-poky-linux/tzdata/tzdata/latest.pkg_postinst
blob: cb36ce81a097c974dc8a8c9c87b5982d9c222e0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
set -e
	etc_lt="$D/etc/localtime"
	src="$D/etc/timezone"

	if [ -e ${src} ] ; then
		tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
	fi

	if [ ! -z "${tz}" -a ! -e "$D/usr/share/zoneinfo/${tz}" ] ; then
		echo "You have an invalid TIMEZONE setting in ${src}"
		echo "Your ${etc_lt} has been reset to Universal; enjoy!"
		tz="Universal"
		echo "Updating ${etc_lt} with $D/usr/share/zoneinfo/${tz}"
		if [ -L ${etc_lt} ] ; then
			rm -f "${etc_lt}"
		fi
		ln -s "/usr/share/zoneinfo/${tz}" "${etc_lt}"
	fi