[Midnightbsd-cvs] src [10242] trunk/share/zoneinfo: update

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jun 2 17:33:26 EDT 2018


Revision: 10242
          http://svnweb.midnightbsd.org/src/?rev=10242
Author:   laffer1
Date:     2018-06-02 17:33:26 -0400 (Sat, 02 Jun 2018)
Log Message:
-----------
update

Modified Paths:
--------------
    trunk/share/zoneinfo/Makefile

Added Paths:
-----------
    trunk/share/zoneinfo/tests/
    trunk/share/zoneinfo/tests/Makefile
    trunk/share/zoneinfo/tests/backward_test.sh
    trunk/share/zoneinfo/tests/zoneinfo_common.sh

Modified: trunk/share/zoneinfo/Makefile
===================================================================
--- trunk/share/zoneinfo/Makefile	2018-06-02 21:28:15 UTC (rev 10241)
+++ trunk/share/zoneinfo/Makefile	2018-06-02 21:33:26 UTC (rev 10242)
@@ -1,11 +1,53 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/share/zoneinfo/Makefile 322100 2017-08-05 16:55:07Z ngie $
 
+#
+# HOW TO UPDATE THE ZONEINFO DATA
+#
+# With the use of subversion, this is a little bit simpler than the CVS method.
+#
+# Import the new sources to the vendor branch:
+#
+# $ cd ~/svn/vendor/tzdata/dist
+# $ tar zxvf /usr/mports/Distfiles/tzdata2008X.tar.gz
+#   (check with "svn stat" and "svn diff" if it all makes sense)
+# $ svn commit	# Commit message: "Vendor import of tzdata2008X (+details)" 
+#
+# Tag it
+#
+# $ cd ~/svn/vendor/tzdata
+# $ svn cp svn+ssh://svn.midnightbsd.org/svn/src/vendor/tzdata/dist \
+#	svn+ssh://svn.midnightbsd.org/svn/src/vendor/tzdata/tzdata2008X
+# $ svn update	# Commit message: "Tag of tzdata2008X"
+#
+# Merge-from-vendor
+#
+# $ cd ~/svn/head/share/zoneinfo
+# $ svn update
+# $ svn merge -c X --accept=postpone \
+#	svn+ssh://svn.midnightbsd.org/svn/src/vendor/tzdata/dist .
+# $ svn update	# Commit message: "MFV of tzdata2008X"
+#
+
+.include <bsd.own.mk>
+
 CLEANFILES+=	yearistype
+CLEANDIRS+=	builddir
 CONTRIBDIR=	${.CURDIR}/../../contrib/tzdata/
 .PATH:		${CONTRIBDIR}
 
 .if defined(LEAPSECONDS)
-LEAPFILE=	-L leapseconds
+.warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead"
+MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
+.endif
+
+.if defined(OLDTIMEZONES)
+.warning "Using backwards compatibility variable for OLDTIMEZONES; please use WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead"
+MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes
+.endif
+
+.if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
+LEAPFILE=	-L ${CONTRIBDIR}leapseconds
 .else
 LEAPFILE=
 .endif
@@ -14,19 +56,51 @@
 		factory northamerica southamerica
 POSIXRULES=	America/New_York
 
-.if defined(OLDTIMEZONES)
+.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
 TZFILES+=	backward systemv
 .endif
 
 TZFILES:=	${TZFILES:S/^/${CONTRIBDIR}/}
 
-all: yearistype
+TZBUILDDIR=	${.OBJDIR}/builddir
+TZBUILDSUBDIRS=	\
+		Africa \
+		America/Argentina \
+		America/Indiana \
+		America/Kentucky \
+		America/North_Dakota \
+		Antarctica \
+		Arctic \
+		Asia \
+		Atlantic \
+		Australia \
+		Etc \
+		Europe \
+		Indian \
+		Pacific \
+		SystemV
 
-beforeinstall:
+.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
+TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
+.endif
+
+all: zoneinfo
+
+.PHONY: zoneinfo
+zoneinfo: yearistype ${TDATA}
+	mkdir -p ${TZBUILDDIR}
+	cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
 	umask 022; cd ${.CURDIR}; \
-	zic -D -d ${DESTDIR}/usr/share/zoneinfo -p ${POSIXRULES} \
-	    -u ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+	zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
 	    ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
+
+beforeinstall:
+	mkdir -p ${DESTDIR}/usr/share/zoneinfo
+	cd ${DESTDIR}/usr/share/zoneinfo;  mkdir -p ${TZBUILDSUBDIRS}
+	cd ${TZBUILDDIR} && \
+	    find -s * -type f -print -exec ${INSTALL} \
+	    -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
+	    \{} ${DESTDIR}/usr/share/zoneinfo/\{} \;
 	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
 	    ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
 
@@ -50,4 +124,8 @@
 		echo "Run tzsetup(8) manually to update /etc/localtime."; \
 	fi
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=	tests
+.endif
+
 .include <bsd.prog.mk>

Added: trunk/share/zoneinfo/tests/Makefile
===================================================================
--- trunk/share/zoneinfo/tests/Makefile	                        (rev 0)
+++ trunk/share/zoneinfo/tests/Makefile	2018-06-02 21:33:26 UTC (rev 10242)
@@ -0,0 +1,19 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/share/zoneinfo/tests/Makefile 322100 2017-08-05 16:55:07Z ngie $
+
+.include <bsd.own.mk>
+
+.PATH: ${SRCTOP}/contrib/tzdata
+
+FILESGROUPS=	FILES
+FILESGROUPS+=	TESTFILES
+
+.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no"
+ATF_TESTS_SH+=	backward_test
+TESTFILES+=	backward
+.endif
+
+TESTFILES+=	zoneinfo_common.sh
+TESTFILESDIR=	${TESTSDIR}
+
+.include <bsd.test.mk>


Property changes on: trunk/share/zoneinfo/tests/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/share/zoneinfo/tests/backward_test.sh
===================================================================
--- trunk/share/zoneinfo/tests/backward_test.sh	                        (rev 0)
+++ trunk/share/zoneinfo/tests/backward_test.sh	2018-06-02 21:33:26 UTC (rev 10242)
@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2017 Ngie Cooper <ngie at FreeBSD.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $MidnightBSD$
+# $FreeBSD: stable/10/share/zoneinfo/tests/backward_test.sh 320703 2017-07-06 04:30:06Z ngie $
+
+atf_test_case links
+links_head()
+{
+	atf_set "descr" "Verify Links directives in contrib/tzdata/backward"
+}
+
+links_body()
+{
+	verify_Links $(atf_get_srcdir)/backward
+}
+
+atf_init_test_cases()
+{
+	. "$(dirname "$0")/zoneinfo_common.sh"
+
+	atf_add_test_case links
+}


Property changes on: trunk/share/zoneinfo/tests/backward_test.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/share/zoneinfo/tests/zoneinfo_common.sh
===================================================================
--- trunk/share/zoneinfo/tests/zoneinfo_common.sh	                        (rev 0)
+++ trunk/share/zoneinfo/tests/zoneinfo_common.sh	2018-06-02 21:33:26 UTC (rev 10242)
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Copyright (c) 2017 Ngie Cooper <ngie at FreeBSD.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $MidnightBSD$
+# $FreeBSD: stable/10/share/zoneinfo/tests/zoneinfo_common.sh 320703 2017-07-06 04:30:06Z ngie $
+
+ZONEINFO_DIR=/usr/share/zoneinfo
+
+verify_Links()
+{
+	local zoneinfo_file
+
+	zoneinfo_file=$1
+
+	awk '$1 == "Link" && NF == 3 { print $2, $3; }' < $zoneinfo_file | \
+	while read src dest; do
+		verify_Link $src $dest
+	done
+}
+
+verify_Link()
+{
+	local src dest
+
+	old_path=$ZONEINFO_DIR/$src
+	new_path=$ZONEINFO_DIR/$dest
+
+	atf_check test -f $new_path
+	atf_check test -f $old_path
+
+	atf_check cmp $old_path $new_path
+}


Property changes on: trunk/share/zoneinfo/tests/zoneinfo_common.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list