Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
Patsy Griffin
c56c88513d Update to tzdata-2025b (#2354293)
- Chile's Aysén Region moves from -04/-03 to -03 year-round,
  diverging from America/Santiago and creating a new zone
  America/Coyhaique.

Resolves: #2354293
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-03-28 20:15:26 -04:00
Patsy Griffin
d5d6570b06 Update to tzdata-2025a
- Paraguay is now permanently at -03. This impacts timestamps
  starting on 2025-03-22.
- Includes improvements to pre-1991 data for the Philippines.
- Etc/Unknown is now reserved.

Resolves: #2338511
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-02-06 11:10:48 -05:00
Patsy Griffin
f5356baafd Update to tzdata-2024b
- System V names are now obsolescent.
- The main data format now uses %z.
- The code now conforms to RFC 8536 for early timestamps.
- Support POSIX.1-2024, which removes asctime_r and ctime_r.
- Assume POSIX.2-1992 or later for shell scripts.
- SUPPORT_C89 now defaults to 1.
- Include two upstream patches for month names as in April vs Apr.

Harden against links to removed zones.

Resolves: #2310315
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-01-08 14:05:57 -05:00
Patsy Griffin
516be14657 Resolves: #2266311
- Add java patch to fix incorrect calculations for
  Africa/Casablanca starting in 2027. (#2266311)
2024-04-08 22:54:23 -04:00
Patsy Griffin
943c5f3ef7 Resolves: #2266697
- Remove hardcoded versioned path to javac
2024-03-13 13:38:30 -04:00
Jiri
4c5bf599db Rebuilt for java-21-openjdk as system jdk
https://fedoraproject.org/wiki/Changes/Java21
2024-03-02 21:36:54 +01:00
8 changed files with 316 additions and 7 deletions

6
.gitignore vendored
View file

@ -214,3 +214,9 @@ noarch/
/tzdata2023d.tar.gz
/tzcode2024a.tar.gz
/tzdata2024a.tar.gz
/tzcode2024b.tar.gz
/tzdata2024b.tar.gz
/tzcode2025a.tar.gz
/tzdata2025a.tar.gz
/tzcode2025b.tar.gz
/tzdata2025b.tar.gz

View file

@ -0,0 +1,23 @@
commit 926b507fa5c3192b1b68fab5910cbd3ba9377c97
Author: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu Sep 5 14:36:02 2024 -0700
"Apr", not "April", in IN column
* northamerica (Rule): Use "Apr", not "April", in the IN column.
Both forms are valid, but "Apr" is more consistent.
Problem reported by Howard Hinnant.
diff --git a/northamerica b/northamerica
index 01f392e0..1af874b6 100644
--- a/northamerica
+++ b/northamerica
@@ -2631,7 +2631,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# http://puentelibre.mx/noticia/ciudad_juarez_cambio_horario_noviembre_2022/
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Mexico 1931 only - April 30 0:00 1:00 D
+Rule Mexico 1931 only - Apr 30 0:00 1:00 D
Rule Mexico 1931 only - Oct 1 0:00 0 S
Rule Mexico 1939 only - Feb 5 0:00 1:00 D
Rule Mexico 1939 only - Jun 25 0:00 0 S

View file

@ -0,0 +1,77 @@
commit 7b6fb155cadd5e5ee70b55c2770e1bdd2f5d2a38
Author: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu Sep 5 14:38:35 2024 -0700
Improve style checks for months
* checktab.awk: Check style of STDOFF and month names.
diff --git a/checktab.awk b/checktab.awk
index 9a26e465..15a3a697 100644
--- a/checktab.awk
+++ b/checktab.awk
@@ -9,6 +9,19 @@ BEGIN {
if (!zone_table) zone_table = "zone1970.tab"
if (!want_warnings) want_warnings = -1
+ monthabbr["Jan"] = 1
+ monthabbr["Feb"] = 1
+ monthabbr["Mar"] = 1
+ monthabbr["Apr"] = 1
+ monthabbr["May"] = 1
+ monthabbr["Jun"] = 1
+ monthabbr["Jul"] = 1
+ monthabbr["Aug"] = 1
+ monthabbr["Sep"] = 1
+ monthabbr["Oct"] = 1
+ monthabbr["Nov"] = 1
+ monthabbr["Dec"] = 1
+
while (getline <iso_table) {
iso_NR++
if ($0 ~ /^#/) continue
@@ -128,12 +141,14 @@ BEGIN {
$1 ~ /^#/ { next }
{
- tz = rules = ""
+ tz = rules = stdoff = ""
if ($1 == "Zone") {
tz = $2
+ stdoff = $3
ruleUsed[$4] = 1
if ($5 ~ /%/) rulePercentUsed[$4] = 1
- } else if ($1 == "Link" && zone_table == "zone.tab") {
+ } else if ($1 == "Link") {
+ if (zone_table == "zone.tab") {
# Ignore Link commands if source and destination basenames
# are identical, e.g. Europe/Istanbul versus Asia/Istanbul.
src = $2
@@ -141,13 +156,27 @@ $1 ~ /^#/ { next }
while ((i = index(src, "/"))) src = substr(src, i+1)
while ((i = index(dst, "/"))) dst = substr(dst, i+1)
if (src != dst) tz = $3
+ }
} else if ($1 == "Rule") {
ruleDefined[$2] = 1
if ($10 != "-") ruleLetters[$2] = 1
+ if (!monthabbr[$6]) {
+ printf "%s:%d: tricky month: %s\n", FILENAME, FNR, $6 \
+ >>"/dev/stderr"
+ status = 1
+ }
} else {
+ stdoff = $1
ruleUsed[$2] = 1
if ($3 ~ /%/) rulePercentUsed[$2] = 1
}
+
+ if (stdoff && stdoff !~ /^\-?1?[0-9](:[0-5][0-9](:[0-5][0-9])?)?$/) {
+ printf "%s:%d: unlikely STDOFF: %s\n", FILENAME, FNR, stdoff \
+ >>"/dev/stderr"
+ status = 1
+ }
+
if (tz && tz ~ /\// && tz !~ /^Etc\//) {
if (!tztab[tz] && FILENAME != "backward" \
&& zone_table != "zonenow.tab") {

17
8051641.patch Normal file
View file

@ -0,0 +1,17 @@
diff -r c8a71253d6e2 -r 189490f29d1e make/src/classes/build/tools/tzdb/ZoneRulesBuilder.java
--- javazic-1.8/build/tools/tzdb/ZoneRulesBuilder.java Thu Oct 23 11:42:20 2014 +0200
+++ javazic-1.8/build/tools/tzdb/ZoneRulesBuilder.java Mon Dec 29 21:42:22 2014 +0300
@@ -491,10 +491,10 @@
TZRule rule = new TZRule(year, month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefinition, savingAmountSecs);
if (lastRule) {
lastRuleList.add(rule);
- maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
} else {
ruleList.add(rule);
}
+ maxLastRuleStartYear = Math.max(startYear, maxLastRuleStartYear);
year++;
}
}
--
cgit v0.9.2

42
ZoneTest.java Normal file
View file

@ -0,0 +1,42 @@
/* Smoke test to ensure that tzdb.data can be loaded.
Copyright (c) 2024 Red Hat, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
import java.time.zone.ZoneRulesProvider;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.Set;
import java.util.TimeZone;
public class ZoneTest {
public static void main(String[] args) {
// This is what failed in OpenJDK's build.tools.cldrconverter.
new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles"),
Locale.US).get(Calendar.YEAR);
// In some OpenJDK versions, this exercises a different parser.
Set<String> available = ZoneRulesProvider.getAvailableZoneIds();
boolean errors = false;
if (available.contains("ROC"))
System.out.println("error: ROC zone is present");
if (!available.contains("America/New_York"))
System.out.println("error: America/New_York is missing");
if (errors)
System.exit(1);
}
}

View file

@ -0,0 +1,84 @@
commit 1bc13a1c10a580f84f1b7686c95344ec2633f611
Author: Florian Weimer <fweimer@openjdk.org>
Date: Thu Sep 26 22:37:45 2024 +0000
8340552: Harden TzdbZoneRulesCompiler against missing zone names
Reviewed-by: andrew, jlu, naoto
diff -ur tzdata-2024b.orig/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java tzdata-2024b/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java
--- tzdata-2024b.orig/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java 2014-04-22 19:46:49.000000000 +0200
+++ tzdata-2024b/javazic-1.8/build/tools/tzdb/TzdbZoneRulesCompiler.java 2024-09-20 21:10:12.748483767 +0200
@@ -248,7 +248,7 @@
// link version-region-rules
out.writeShort(builtZones.size());
for (Map.Entry<String, ZoneRules> entry : builtZones.entrySet()) {
- int regionIndex = Arrays.binarySearch(regionArray, entry.getKey());
+ int regionIndex = findRegionIndex(regionArray, entry.getKey());
int rulesIndex = rulesList.indexOf(entry.getValue());
out.writeShort(regionIndex);
out.writeShort(rulesIndex);
@@ -256,8 +256,8 @@
// alias-region
out.writeShort(links.size());
for (Map.Entry<String, String> entry : links.entrySet()) {
- int aliasIndex = Arrays.binarySearch(regionArray, entry.getKey());
- int regionIndex = Arrays.binarySearch(regionArray, entry.getValue());
+ int aliasIndex = findRegionIndex(regionArray, entry.getKey());
+ int regionIndex = findRegionIndex(regionArray, entry.getValue());
out.writeShort(aliasIndex);
out.writeShort(regionIndex);
}
@@ -269,6 +269,14 @@
}
}
+ private static int findRegionIndex(String[] regionArray, String region) {
+ int index = Arrays.binarySearch(regionArray, region);
+ if (index < 0) {
+ throw new IllegalArgumentException("Unknown region: " + region);
+ }
+ return index;
+ }
+
private static final Pattern YEAR = Pattern.compile("(?i)(?<min>min)|(?<max>max)|(?<only>only)|(?<year>[0-9]+)");
private static final Pattern MONTH = Pattern.compile("(?i)(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|(aug)|(sep)|(oct)|(nov)|(dec)");
private static final Matcher DOW = Pattern.compile("(?i)(mon)|(tue)|(wed)|(thu)|(fri)|(sat)|(sun)").matcher("");
@@ -607,22 +615,20 @@
}
builtZones.put(aliasId, realRules);
}
- // remove UTC and GMT
- // builtZones.remove("UTC");
- // builtZones.remove("GMT");
- // builtZones.remove("GMT0");
- builtZones.remove("GMT+0");
- builtZones.remove("GMT-0");
- links.remove("GMT+0");
- links.remove("GMT-0");
- // remove ROC, which is not supported in j.u.tz
- builtZones.remove("ROC");
- links.remove("ROC");
- // remove EST, HST and MST. They are supported via
- // the short-id mapping
- builtZones.remove("EST");
- builtZones.remove("HST");
- builtZones.remove("MST");
+
+ List<String> zonesToRemove = Arrays.asList(
+ // remove UTC and GMT
+ "GMT+0",
+ "GMT-0",
+ // remove ROC, which is not supported in j.u.tz
+ "ROC",
+ // remove EST, HST and MST. They are supported via
+ // the short-id mapping
+ "EST",
+ "HST",
+ "MST");
+ builtZones.keySet().removeAll(zonesToRemove);
+ links.keySet().removeAll(zonesToRemove);
}
/**

View file

@ -1,3 +1,3 @@
SHA512 (javazic-1.8-37392f2f5d59.tar.xz) = 2ba718dfeed53a3bd6b44e3dfe96338a609e482e4e6d942e2a7e622fc6c52606cb323ac3a59739c463e34f70fff217c0a61f5b3d3c4958eff2801b1504ee4204
SHA512 (tzcode2024a.tar.gz) = 46da8bfa762c7d109db93e5c060789097fc0e1e38bdad5bb8fec886ef47f138bd03b913a743cd5f7e23dc359a72bfd63e7ffc0de199d2b51e6a174361dbdc43c
SHA512 (tzdata2024a.tar.gz) = 1f09f1b2327cc9e1afc7e9045e83ee3377918dafe1bee2f282b6991828d03b3c70a4d3a17f9207dfb1361bb25bc214a8922a756e84fa114e9ba476226db57236
SHA512 (tzcode2025b.tar.gz) = 19826b12968c10fc4db7e4b07ba782bfb8590eeebaec6f719d74b92a2e642ab817bd72bceff0015ce52a838edfdb00753b3cd87dd84b35abf2606e5bee445f76
SHA512 (tzdata2025b.tar.gz) = 7d83741f3cae81fac8131994b43c55b6da7328df18b706e5ee40e9b3212bc506e6f8fc90988b18da424ed59eff69bce593f2783b7b5f18eb483a17aeb94258d6

View file

@ -1,9 +1,9 @@
Summary: Timezone data
Name: tzdata
Version: 2024a
%define tzdata_version 2024a
%define tzcode_version 2024a
Release: 2%{?dist}
Version: 2025b
%define tzdata_version 2025b
%define tzcode_version 2025b
Release: 1%{?dist}
License: LicenseRef-Fedora-Public-Domain AND (GPL-2.0-only WITH ClassPath-exception-2.0)
URL: https://www.iana.org/time-zones
Source0: ftp://ftp.iana.org/tz/releases/tzdata%{tzdata_version}.tar.gz
@ -13,6 +13,7 @@ Patch002: 0002-Fix-have-snprintf-error.patch
Patch003: 0003-continue-to-ship-posixrules.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: gawk, glibc, perl-interpreter
BuildRequires: java-devel
BuildRequires: glibc-common >= 2.5.90-7
@ -27,6 +28,9 @@ the world.
%package java
Summary: Timezone data for Java
Source3: javazic-1.8-37392f2f5d59.tar.xz
Source4: ZoneTest.java
Patch100: 8051641.patch
Patch101: javazic-harden-links.patch
%description java
This package contains timezone information for use by Java runtimes.
@ -54,6 +58,8 @@ tar zxf rearguard/tzdata%{version}-rearguard.tar.gz
%endif
tar xf %{SOURCE3}
%patch -P 100
%patch -p1 -P 101
echo "%{name}%{tzdata_version}" >> VERSION
@ -84,7 +90,7 @@ JAVA_FILES="rearguard/africa rearguard/antarctica rearguard/asia \
# Java 8 tzdata
pushd javazic-1.8
/usr/lib/jvm/java-17-openjdk/bin/javac -source 1.8 -target 1.8 -classpath . `find . -name \*.java`
javac -source 1.8 -target 1.8 -classpath . `find . -name \*.java`
popd
java -classpath javazic-1.8 build.tools.tzdb.TzdbZoneRulesCompiler \
@ -100,6 +106,25 @@ install -p -m 644 zone.tab zone1970.tab iso3166.tab leap-seconds.list leapsecond
mkdir -p $RPM_BUILD_ROOT%{_datadir}/javazi-1.8
install -p -m 644 tzdb.dat $RPM_BUILD_ROOT%{_datadir}/javazi-1.8/
%check
echo ============TESTING===============
/usr/bin/env LANG=C make -k VALIDATE=':' check && true
# Create a custom JAVA_HOME, where we can replace tzdb.dat with the
# one just built, for testing.
system_java_home=$(dirname $(readlink -f $(which java)))/..
mkdir -p java_home
cp -Lr $system_java_home/* java_home/.
for tzdb in $(find java_home -name tzdb.dat) ; do
rm $tzdb
cp $RPM_BUILD_ROOT%{_datadir}/javazi-1.8/tzdb.dat $tzdb
done
# Compile the smoke test and run it.
cp %{SOURCE4} .
javac ZoneTest.java
java_home/bin/java ZoneTest
echo ============END TESTING===========
%files
%{_datadir}/zoneinfo
%license LICENSE
@ -112,6 +137,41 @@ install -p -m 644 tzdb.dat $RPM_BUILD_ROOT%{_datadir}/javazi-1.8/
%{_datadir}/javazi-1.8
%changelog
* Thu Mar 27 2025 Patsy Griffin <patsy@redhat.com> - 2025b-1
Update to tzdata-2025b (#2354293)
- Chile's Aysén Region moves from -04/-03 to -03 year-round,
diverging from America/Santiago and creating a new zone
America/Coyhaique.
* Tue Feb 04 2025 Patsy Griffin <patsy@redhat.com> - 2025a-1
Update to tzdata-2025a (#2338511)
- Paraguay is now permanently at -03. This impacts timestamps
starting on 2025-03-22.
- Includes improvements to pre-1991 data for the Philippines.
- Etc/Unknown is now reserved.
* Wed Jan 08 2025 Patsy Griffin <patsy@redhat.com> - 2024b-1
- Rebase to tzdata-2024b (#2310315)
- Improve historical data for Mexico, Mongolia, and Portugal.
- System V names are now obsolescent.
- The main data form now uses %z.
- The code now conforms to RFC 8536 for early timestamps.
- Support POSIX.1-2024, which removes asctime_r and ctime_r.
- Assume POSIX.2-1992 or later for shell scripts.
- SUPPORT_C89 now defaults to 1.
- Include two upstream patches for month names as in April vs Apr.
- Harden against links to removed zones
* Thu Apr 04 2024 Patsy Griffin <patsy@redhat.com> - 2024a-5
- Add java patch to fix incorrect calculations for
Africa/Casablanca starting in 2027. (#2266311)
* Wed Mar 13 2024 Patsy Griffin <patsy@redhat.com> - 2024a-4
- Remove hardcoded versioned path to javac.
* Sat Mar 02 2024 Jiri Vanek <jvanek@redhat.com> - 2024a-3
- Rebuilt for java-21-openjdk as system jdk
* Tue Feb 06 2024 Patsy Griffin <patsy@redhat.com> - 2024a-2
- Correct the bz# for the tzdata-2024 commit.