Commit 14a18326 authored by Tom Lane's avatar Tom Lane

Update win32tzlist.pl for the new location of our Windows timezone map.

I wasn't aware of this script till Magnus mentioned it just now ...
parent 0c8eda62
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
################################################################# #################################################################
# #
# This script compares the timezone information in the Windows # This script compares the timezone information in the Windows registry
# registry with that in pgtz.c. A list of changes will be written # with that in src/bin/initdb/findtimezone.c. A list of changes will be
# to stdout - no attempt is made to automatically edit the file. # written to stdout - no attempt is made to automatically edit the file.
# #
# Run the script from the src/timezone directory. # Run the script from the top-level PG source directory.
# #
use strict; use strict;
...@@ -20,6 +20,8 @@ use warnings; ...@@ -20,6 +20,8 @@ use warnings;
use Win32::Registry; use Win32::Registry;
my $tzfile = 'src/bin/initdb/findtimezone.c';
# #
# Fetch all timezones in the registry # Fetch all timezones in the registry
# #
...@@ -57,16 +59,16 @@ $basekey->Close(); ...@@ -57,16 +59,16 @@ $basekey->Close();
# Fetch all timezones currently in the file # Fetch all timezones currently in the file
# #
my @file_zones; my @file_zones;
open(PGTZ,'<pgtz.c') or die "Could not open pgtz.c!\n"; open(TZFILE,"<$tzfile") or die "Could not open $tzfile!\n";
my $t = $/; my $t = $/;
undef $/; undef $/;
my $pgtz = <PGTZ>; my $pgtz = <TZFILE>;
close(PGTZ); close(TZFILE);
$/ = $t; $/ = $t;
# Attempt to locate and extract the complete win32_tzmap struct # Attempt to locate and extract the complete win32_tzmap struct
$pgtz =~ /win32_tzmap\[\] =\s+{\s+\/\*[^\/]+\*\/\s+(.+?)};/gs $pgtz =~ /win32_tzmap\[\] =\s+{\s+\/\*[^\/]+\*\/\s+(.+?)};/gs
or die "Could not locate struct win32_tzmap in pgtz.c!"; or die "Could not locate struct win32_tzmap in $tzfile!";
$pgtz = $1; $pgtz = $1;
# Extract each individual record from the struct # Extract each individual record from the struct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment