Page MenuHomeFreeBSD

D20981.diff
No OneTemporary

D20981.diff

Index: head/misc/zoneinfo/Makefile
===================================================================
--- head/misc/zoneinfo/Makefile
+++ head/misc/zoneinfo/Makefile
@@ -3,6 +3,7 @@
PORTNAME= zoneinfo
DISTVERSION= 2019b
+PORTREVISION= 1
CATEGORIES= misc
MASTER_SITES= https://data.iana.org/time-zones/releases/ \
ftp://ftp.iana.org/tz/releases/
@@ -18,61 +19,88 @@
NO_ARCH= yes
OPTIONS_DEFINE= BACKWARD
-OPTIONS_DEFAULT= BACKWARD
+OPTIONS_DEFAULT=
OPTIONS_SUB= yes
-BACKWARD_DESC= Include backwards compatible zones
+BACKWARD_DESC= Include backwards compatible zones
+BACKWARD_VARS= tzfiles+=backward
TZFILES= africa antarctica asia australasia etcetera europe \
factory northamerica southamerica systemv
POSIXRULES= America/New_York
-.include <bsd.port.options.mk>
+# Run both of:
+# "make DEVELOPER=1 WITHOUT=BACKWARD do-clean test-pkgplist"
+# and
+# "make DEVELOPER=1 WITH=BACKWARD do-clean test-pkgplist"
+# before commiting!
-.if ${PORT_OPTIONS:MBACKWARD}
-TZFILES+= backward
-.endif
-
-# Run with "DEVELOPER=1 make check-plist" before commiting!
-
# Make sure it breaks when the distfile isn't there anymore.
.if !defined(PACKAGE_BUILDING)
MASTER_SITES+= http://people.freebsd.org/~edwin/
.endif
-.include <bsd.port.pre.mk>
+# tzsetup objects (fatally) if any entry in zone.tab or zone1970.tab
+# refers to a country code that doesn't exist in misc/iso3166. While
+# arguably that should be fixed, for compatibility we remove such
+# entries here to avoid the problem.
+#
+# This used to be done by adding patch files for each country to
+# remove, but that doesn't work for zone1970.tab.
+#
+# We generate a list of all 2-letter codes that are NOT in iso3166;
+# then, for any entry in zone.tab or zone1970.tab that contains a bad
+# code: first emit a commented-out version of the line, then a version
+# with the bad codes stripped out of the first field (unless this
+# leaves the first field empty).
-# The following country codes can be missing from /usr/share/misc/iso3166 and
-# shouldn't appear in the zoneinfo file.
-MISSING= ax bl bq cw gg im je me mf rs ss sx
+post-patch:
+ cd ${WRKSRC}; \
+ badc=$$(${AWK} '/^[^\#]/ { t[$$1]=1; }; \
+ END { for (i=0; i<676; ++i) { \
+ c = sprintf("%c%c", 65+int(i/26), 65+(i%26)); \
+ if (!(c in t)) print c; \
+ } \
+ }' \
+ /usr/share/misc/iso3166 | \
+ ${SED} -n -e '1h; 1!H; $${g;s/\n/|/g;p;}'); \
+ for fn in zone.tab zone1970.tab; do \
+ ${MV} $${fn} $${fn}.bak; \
+ ${AWK} -v FS="\t" -v OFS="\t" -v re="(^|,)($${badc})" \
+ '/^[^#]/ && $$1 ~ re { \
+ print "#" $$0; \
+ gsub(re,"",$$1); \
+ sub(/^,/,"",$$1); \
+ }; \
+ $$1 != "" { print; }' <$${fn}.bak >$${fn}; \
+ done
-.ifndef NOMISSING
-.for M in ${MISSING}
-HAS_${M:tu}!= ${GREP} -c ^${M:tu} /usr/share/misc/iso3166 || ${TRUE}
-.if ${HAS_${M:tu}} == "0"
-EXTRA_PATCHES+= ${FILESDIR}/patchremove-${M}
-.endif
-.endfor
-.endif
-
do-build:
umask 022; \
cd ${WRKSRC}; \
zic -d ${WRKSRC}/zoneinfo -p ${POSIXRULES} -m ${NOBINMODE} \
- ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
+ -y ${.OBJDIR}/yearistype ${TZFILES}
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/share/zoneinfo
- ${CP} -R -p ${WRKSRC}/zoneinfo/ ${STAGEDIR}${PREFIX}/share/zoneinfo
+ (cd ${WRKSRC}/zoneinfo && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/zoneinfo)
${INSTALL_DATA} ${WRKSRC}/zone.tab ${STAGEDIR}${PREFIX}/share/zoneinfo
+ ${INSTALL_DATA} ${WRKSRC}/zone1970.tab ${STAGEDIR}${PREFIX}/share/zoneinfo
-test-patches:
-.for M in ${MISSING}
- make clean
- NOMISSING=1 EXTRA_PATCHES=${FILESDIR}/patchremove-${M} make patch
-.endfor
+# check-plist is too lenient for us; it doesn't care if there are
+# files in the stage dir that are commented out in plist due to port
+# options. But we need to check for an exact match, otherwise the
+# final package may be incorrect if entries move into or out of the
+# "backward" file.
+#
+# So this rule makes the additional check that there must be no file in
+# STAGEDIR not accounted for by .plist-files-no-comments.
-test-pkgplist:
- for f in $$(find work/stage/usr/share/zoneinfo/ | sed -e 's,work/stage/usr/share/zoneinfo/,,' ); do if [ $$(grep -c $$f pkg-plist) -eq 0 ]; then echo $$f; fi ; done
+test-pkgplist: check-plist
+ @(cd ${STAGEDIR} && ${FIND} . -type f -print) | \
+ ${SED} -e 's:^[.]::' | sort | \
+ ${COMM} -23 -- - ${WRKDIR}/.plist-files-no-comments | \
+ while read -r f; do echo "MISSING FROM PLIST: $$f" >&2; echo fail; done | \
+ ! ${GREP} fail >/dev/null
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: head/misc/zoneinfo/files/patch-etcetera
===================================================================
--- head/misc/zoneinfo/files/patch-etcetera
+++ head/misc/zoneinfo/files/patch-etcetera
@@ -0,0 +1,14 @@
+--- etcetera.orig 2019-07-23 03:26:15 UTC
++++ etcetera
+@@ -22,8 +22,10 @@ Zone Etc/UTC 0 - UTC
+
+ # The following link uses older naming conventions,
+ # but it belongs here, not in the file 'backward',
+-# as functions like gmtime load the "GMT" file to handle leap seconds properly.
++# as functions like gmtime load the "UTC" file to handle leap seconds properly.
+ # We want this to work even on installations that omit the other older names.
++Link Etc/UTC UTC
++# Do the same for GMT for compatibility reasons.
+ Link Etc/GMT GMT
+
+ Link Etc/UTC Etc/Universal
Index: head/misc/zoneinfo/files/patch-zone1970.tab
===================================================================
--- head/misc/zoneinfo/files/patch-zone1970.tab
+++ head/misc/zoneinfo/files/patch-zone1970.tab
@@ -0,0 +1,12 @@
+--- zone1970.tab.orig 2019-06-22 19:39:01 UTC
++++ zone1970.tab
+@@ -9,7 +9,8 @@
+ # UTF-8 encoding. The columns of the table are as follows:
+ #
+ # 1. The countries that overlap the timezone, as a comma-separated list
+-# of ISO 3166 2-character country codes. See the file 'iso3166.tab'.
++# of ISO 3166 2-character country codes.
++# See the file '/usr/share/misc/iso3166'.
+ # 2. Latitude and longitude of the timezone's principal location
+ # in ISO 6709 sign-degrees-minutes-seconds format,
+ # either ±DDMM±DDDMM or ±DDMMSS±DDDMMSS,
Index: head/misc/zoneinfo/files/patchremove-ax
===================================================================
--- head/misc/zoneinfo/files/patchremove-ax
+++ head/misc/zoneinfo/files/patchremove-ax
@@ -1,11 +0,0 @@
---- zone.tab.orig Tue Aug 21 00:45:10 2007
-+++ zone.tab Fri Oct 12 07:10:31 2007
-@@ -66,7 +66,7 @@
- AU -3157+11551 Australia/Perth Western Australia - most locations
- AU -3143+12852 Australia/Eucla Western Australia - Eucla area
- AW +1230-06958 America/Aruba
--AX +6006+01957 Europe/Mariehamn
-+#AX +6006+01957 Europe/Mariehamn
- AZ +4023+04951 Asia/Baku
- BA +4352+01825 Europe/Sarajevo
- BB +1306-05937 America/Barbados
Index: head/misc/zoneinfo/files/patchremove-bl
===================================================================
--- head/misc/zoneinfo/files/patchremove-bl
+++ head/misc/zoneinfo/files/patchremove-bl
@@ -1,11 +0,0 @@
---- zone.tab.orig Tue Dec 4 09:46:40 2007
-+++ zone.tab Tue Dec 4 09:46:50 2007
-@@ -77,7 +77,7 @@
- BH +2623+05035 Asia/Bahrain
- BI -0323+02922 Africa/Bujumbura
- BJ +0629+00237 Africa/Porto-Novo
--BL +1753-06251 America/St_Barthelemy
-+#BL +1753-06251 America/St_Barthelemy
- BM +3217-06446 Atlantic/Bermuda
- BN +0456+11455 Asia/Brunei
- BO -1630-06809 America/La_Paz
Index: head/misc/zoneinfo/files/patchremove-bq
===================================================================
--- head/misc/zoneinfo/files/patchremove-bq
+++ head/misc/zoneinfo/files/patchremove-bq
@@ -1,11 +0,0 @@
---- zone.tab.orig 2011-09-01 17:55:11.000000000 +1000
-+++ zone.tab 2011-09-01 17:55:21.000000000 +1000
-@@ -86,7 +86,7 @@
- BM +3217-06446 Atlantic/Bermuda
- BN +0456+11455 Asia/Brunei
- BO -1630-06809 America/La_Paz
--BQ +120903-0681636 America/Kralendijk
-+#BQ +120903-0681636 America/Kralendijk
- BR -0351-03225 America/Noronha Atlantic islands
- BR -0127-04829 America/Belem Amapa, E Para
- BR -0343-03830 America/Fortaleza NE Brazil (MA, PI, CE, RN, PB)
Index: head/misc/zoneinfo/files/patchremove-cw
===================================================================
--- head/misc/zoneinfo/files/patchremove-cw
+++ head/misc/zoneinfo/files/patchremove-cw
@@ -1,11 +0,0 @@
---- zone.tab.orig 2011-09-01 17:55:33.000000000 +1000
-+++ zone.tab 2011-09-01 17:56:54.000000000 +1000
-@@ -155,7 +155,7 @@
- CR +0956-08405 America/Costa_Rica
- CU +2308-08222 America/Havana
- CV +1455-02331 Atlantic/Cape_Verde
--CW +1211-06900 America/Curacao
-+#CW +1211-06900 America/Curacao
- CX -1025+10543 Indian/Christmas
- CY +3510+03322 Asia/Nicosia
- CZ +5005+01426 Europe/Prague
Index: head/misc/zoneinfo/files/patchremove-gg
===================================================================
--- head/misc/zoneinfo/files/patchremove-gg
+++ head/misc/zoneinfo/files/patchremove-gg
@@ -1,11 +0,0 @@
---- zone.tab.orig Tue Aug 29 18:02:45 2006
-+++ zone.tab Tue Aug 29 18:02:56 2006
-@@ -178,7 +178,7 @@
- GD +1203-06145 America/Grenada
- GE +4143+04449 Asia/Tbilisi
- GF +0456-05220 America/Cayenne
--GG +4927-00232 Europe/Guernsey
-+#GG +4927-00232 Europe/Guernsey
- GH +0533-00013 Africa/Accra
- GI +3608-00521 Europe/Gibraltar
- GL +6411-05144 America/Godthab most locations
Index: head/misc/zoneinfo/files/patchremove-im
===================================================================
--- head/misc/zoneinfo/files/patchremove-im
+++ head/misc/zoneinfo/files/patchremove-im
@@ -1,11 +0,0 @@
---- zone.tab.orig 2013-09-11 10:47:17.000000000 +1000
-+++ zone.tab 2013-10-10 06:13:41.000000000 +1100
-@@ -225,7 +225,7 @@
- ID -0232+14042 Asia/Jayapura west New Guinea (Irian Jaya) & Malukus (Moluccas)
- IE +5320-00615 Europe/Dublin
- IL +314650+0351326 Asia/Jerusalem
--IM +5409-00428 Europe/Isle_of_Man
-+#IM +5409-00428 Europe/Isle_of_Man
- IN +2232+08822 Asia/Kolkata
- IO -0720+07225 Indian/Chagos
- IQ +3321+04425 Asia/Baghdad
Index: head/misc/zoneinfo/files/patchremove-je
===================================================================
--- head/misc/zoneinfo/files/patchremove-je
+++ head/misc/zoneinfo/files/patchremove-je
@@ -1,11 +0,0 @@
---- zone.tab.orig 2013-09-11 10:47:17.000000000 +1000
-+++ zone.tab 2013-10-10 06:14:19.000000000 +1100
-@@ -232,7 +232,7 @@
- IR +3540+05126 Asia/Tehran
- IS +6409-02151 Atlantic/Reykjavik
- IT +4154+01229 Europe/Rome
--JE +4912-00207 Europe/Jersey
-+#JE +4912-00207 Europe/Jersey
- JM +175805-0764736 America/Jamaica
- JO +3157+03556 Asia/Amman
- JP +353916+1394441 Asia/Tokyo
Index: head/misc/zoneinfo/files/patchremove-me
===================================================================
--- head/misc/zoneinfo/files/patchremove-me
+++ head/misc/zoneinfo/files/patchremove-me
@@ -1,8 +0,0 @@
---- zone.tab.orig Tue Dec 4 01:50:41 2007
-+++ zone.tab Tue Dec 4 09:57:33 2007
-@@ -250,4 +250,4 @@
- MA +3339-00735 Africa/Casablanca
- MC +4342+00723 Europe/Monaco
- MD +4700+02850 Europe/Chisinau
--ME +4226+01916 Europe/Podgorica
-+#ME +4226+01916 Europe/Podgorica
Index: head/misc/zoneinfo/files/patchremove-mf
===================================================================
--- head/misc/zoneinfo/files/patchremove-mf
+++ head/misc/zoneinfo/files/patchremove-mf
@@ -1,7 +0,0 @@
---- zone.tab.orig Tue Dec 4 01:50:41 2007
-+++ zone.tab Tue Dec 4 09:57:33 2007
-@@ -254,3 +254,3 @@
--MF +1804-06305 America/Marigot
-+#MF +1804-06305 America/Marigot
- MG -1855+04731 Indian/Antananarivo
- MH +0709+17112 Pacific/Majuro most locations
Index: head/misc/zoneinfo/files/patchremove-rs
===================================================================
--- head/misc/zoneinfo/files/patchremove-rs
+++ head/misc/zoneinfo/files/patchremove-rs
@@ -1,11 +0,0 @@
---- zone.tab.orig Tue Oct 17 07:38:12 2006
-+++ zone.tab Tue Oct 17 07:38:31 2006
-@@ -312,7 +312,7 @@
- QA +2517+05132 Asia/Qatar
- RE -2052+05528 Indian/Reunion
- RO +4426+02606 Europe/Bucharest
--RS +4450+02030 Europe/Belgrade
-+#RS +4450+02030 Europe/Belgrade
- RU +5443+02030 Europe/Kaliningrad Moscow-01 - Kaliningrad
- RU +5545+03735 Europe/Moscow Moscow+00 - west Russia
- RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea
Index: head/misc/zoneinfo/files/patchremove-ss
===================================================================
--- head/misc/zoneinfo/files/patchremove-ss
+++ head/misc/zoneinfo/files/patchremove-ss
@@ -1,11 +0,0 @@
---- zone.tab.orig 2011-09-01 17:52:14.000000000 +1000
-+++ zone.tab 2011-09-01 17:52:21.000000000 +1000
-@@ -361,7 +361,7 @@
- SN +1440-01726 Africa/Dakar
- SO +0204+04522 Africa/Mogadishu
- SR +0550-05510 America/Paramaribo
--SS +0451+03136 Africa/Juba
-+#SS +0451+03136 Africa/Juba
- ST +0020+00644 Africa/Sao_Tome
- SV +1342-08912 America/El_Salvador
- SX +180305-0630250 America/Lower_Princes
Index: head/misc/zoneinfo/files/patchremove-sx
===================================================================
--- head/misc/zoneinfo/files/patchremove-sx
+++ head/misc/zoneinfo/files/patchremove-sx
@@ -1,11 +0,0 @@
---- zone.tab.orig 2011-09-01 17:57:06.000000000 +1000
-+++ zone.tab 2011-09-01 17:57:40.000000000 +1000
-@@ -364,7 +364,7 @@
- SS +0451+03136 Africa/Juba
- ST +0020+00644 Africa/Sao_Tome
- SV +1342-08912 America/El_Salvador
--SX +180305-0630250 America/Lower_Princes
-+#SX +180305-0630250 America/Lower_Princes
- SY +3330+03618 Asia/Damascus
- SZ -2618+03106 Africa/Mbabane
- TC +2128-07108 America/Grand_Turk
Index: head/misc/zoneinfo/pkg-plist
===================================================================
--- head/misc/zoneinfo/pkg-plist
+++ head/misc/zoneinfo/pkg-plist
@@ -351,7 +351,6 @@
%%DATADIR%%/Etc/GMT-9
%%DATADIR%%/Etc/GMT0
%%DATADIR%%/Etc/Greenwich
-%%DATADIR%%/Etc/UCT
%%DATADIR%%/Etc/UTC
%%DATADIR%%/Etc/Universal
%%DATADIR%%/Etc/Zulu
@@ -472,9 +471,11 @@
%%DATADIR%%/Pacific/Tongatapu
%%DATADIR%%/Pacific/Wake
%%DATADIR%%/Pacific/Wallis
+%%DATADIR%%/UTC
%%DATADIR%%/WET
%%DATADIR%%/posixrules
%%DATADIR%%/zone.tab
+%%DATADIR%%/zone1970.tab
%%BACKWARD%%%%DATADIR%%/Africa/Asmera
%%BACKWARD%%%%DATADIR%%/Africa/Timbuktu
%%BACKWARD%%%%DATADIR%%/America/Argentina/ComodRivadavia
@@ -542,6 +543,7 @@
%%BACKWARD%%%%DATADIR%%/Cuba
%%BACKWARD%%%%DATADIR%%/Egypt
%%BACKWARD%%%%DATADIR%%/Eire
+%%BACKWARD%%%%DATADIR%%/Etc/UCT
%%BACKWARD%%%%DATADIR%%/Europe/Belfast
%%BACKWARD%%%%DATADIR%%/Europe/Tiraspol
%%BACKWARD%%%%DATADIR%%/GB
@@ -589,7 +591,6 @@
%%BACKWARD%%%%DATADIR%%/US/Mountain
%%BACKWARD%%%%DATADIR%%/US/Pacific
%%BACKWARD%%%%DATADIR%%/US/Samoa
-%%BACKWARD%%%%DATADIR%%/UTC
%%BACKWARD%%%%DATADIR%%/Universal
%%BACKWARD%%%%DATADIR%%/W-SU
%%BACKWARD%%%%DATADIR%%/Zulu

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 23, 4:11 PM (10 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27887413
Default Alt Text
D20981.diff (14 KB)

Event Timeline