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/a2bd77fd-61b8-4c2b-b12e-3e22ae260f82@eisentraut.org
This commit is contained in:
Andrew Dunstan 2023-12-22 13:56:27 +00:00
parent 8793c60051
commit 8ddf9c1dc0
1 changed files with 12 additions and 1 deletions

View File

@ -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';