diff options
author | Andrew Dunstan | 2023-12-22 13:56:27 +0000 |
---|---|---|
committer | Andrew Dunstan | 2023-12-22 13:56:27 +0000 |
commit | 8ddf9c1dc020d569d3a0aa22e3269a64e8a4ef23 (patch) | |
tree | 40943b979650973bc97168f1b170b944b38be17a | |
parent | 8793c60051541c8df8dbe133cb9cf8138efe3b3f (diff) |
Make win32tzlist.pl checkable again
Commit 1301c80b21 removed some infrastructure needed to check
windows-oriented perl scripts. It also removed most such scripts, but
this one was left over. We repair the damage by making Win32::Registry a
conditional requirement that is only loaded on Windows. With this change
`perl -cw win32tzlist.pl` once again passes on non-Windows machines.
Discussion: https://postgr.es/m/[email protected]
-rwxr-xr-x | src/tools/win32tzlist.pl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tools/win32tzlist.pl b/src/tools/win32tzlist.pl index 657f7d4879c..457462df274 100755 --- a/src/tools/win32tzlist.pl +++ b/src/tools/win32tzlist.pl @@ -18,7 +18,18 @@ use strict; use warnings; -use Win32::Registry; +use Config; + +our $HKEY_LOCAL_MACHINE; + +BEGIN +{ + if ($Config{osname} eq 'MSWin32' || $Config{osname} eq 'msys') + { + require Win32::Registry; + Win32::Registry->import; + } +} my $tzfile = 'src/bin/initdb/findtimezone.c'; |