|
8 | 8 | ################################################################# |
9 | 9 |
|
10 | 10 | # |
11 | | -# This script compares the timezone information in the Windows |
12 | | -#registrywith that inpgtz.c. A list of changes will be written |
13 | | -# to stdout - no attempt is made to automatically edit the file. |
| 11 | +# This script compares the timezone information in the Windows registry |
| 12 | +# with that insrc/bin/initdb/findtimezone.c.A list of changes will be |
| 13 | +#writtento stdout - no attempt is made to automatically edit the file. |
14 | 14 | # |
15 | | -# Run the script from thesrc/timezone directory. |
| 15 | +# Run the script from thetop-level PG source directory. |
16 | 16 | # |
17 | 17 |
|
18 | 18 | use strict; |
19 | 19 | use warnings; |
20 | 20 |
|
21 | 21 | use Win32::Registry; |
22 | 22 |
|
| 23 | +my$tzfile ='src/bin/initdb/findtimezone.c'; |
| 24 | + |
23 | 25 | # |
24 | 26 | # Fetch all timezones in the registry |
25 | 27 | # |
|
57 | 59 | # Fetch all timezones currently in the file |
58 | 60 | # |
59 | 61 | my@file_zones; |
60 | | -open(PGTZ,'<pgtz.c')ordie"Could not openpgtz.c!\n"; |
| 62 | +open(TZFILE,"<$tzfile")ordie"Could not open$tzfile!\n"; |
61 | 63 | my$t =$/; |
62 | 64 | undef$/; |
63 | | -my$pgtz = <PGTZ>; |
64 | | -close(PGTZ); |
| 65 | +my$pgtz = <TZFILE>; |
| 66 | +close(TZFILE); |
65 | 67 | $/ =$t; |
66 | 68 |
|
67 | 69 | # Attempt to locate and extract the complete win32_tzmap struct |
68 | 70 | $pgtz =~/win32_tzmap\[\] =\s+{\s+\/\*[^\/]+\*\/\s+(.+?)};/gs |
69 | | -ordie"Could not locate struct win32_tzmap inpgtz.c!"; |
| 71 | +ordie"Could not locate struct win32_tzmap in$tzfile!"; |
70 | 72 | $pgtz =$1; |
71 | 73 |
|
72 | 74 | # Extract each individual record from the struct |
|