From ec50bd2dc073063cd6fdb77344b2850072ce342c Mon Sep 17 00:00:00 2001 From: edwin Date: Wed, 21 Oct 2009 20:59:12 +0000 Subject: After the installation of the /usr/share/zoneinfo, run tzsetup if /var/db/zoneinfo exists. MFC after: 1 week --- share/zoneinfo/Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'share/zoneinfo') diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile index e254277..6acd502 100644 --- a/share/zoneinfo/Makefile +++ b/share/zoneinfo/Makefile @@ -54,4 +54,24 @@ beforeinstall: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ +afterinstall: + @# + @# If the file /var/db/zoneinfo exists, and it is owned by root:wheel, + @# and the contents of it exists in /usr/share/zoneinfo, then reinstall + @# it. + @# + @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \ + -a -G ${DESTDIR}/var/db/zoneinfo ]; then \ + zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \ + if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \ + if [ ! -z "${DESTDIR}" ]; then \ + optC="-C ${DESTDIR}"; \ + fi; \ + echo "Updating /etc/localtime"; \ + tzsetup ${optC} -r; \ + fi; \ + else \ + echo "Run tzsetup(8) manually to update /etc/localtime."; \ + fi + .include -- cgit v1.1