Fix unpacking of GeoLite2 database (#1516)

Apparently you can't unpack and uncompress in one go in Windows and tar -C doesn't affect the input file.
This commit is contained in:
peace-maker 2021-06-30 13:32:40 +02:00 committed by GitHub
parent b0563a493c
commit d192527707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,12 +54,13 @@ while (my $ln = <$fh>) {
}
close($fh);
unless (-e '../GeoLite2-City_20191217.tar.gz')
unless (-e '../GeoLite2-City_20191217.tar')
{
print "Downloading GeoLite2-City.mmdb...\n";
# Don't check certificate. It will fail on the slaves and we're resolving to internal addressing anyway
system('wget --no-check-certificate -q -O ../GeoLite2-City_20191217.tar.gz https://sm.alliedmods.net/GeoLite2-City_20191217.tar.gz');
system('tar -C ../ -xzf GeoLite2-City_20191217.tar.gz');
system('gunzip ../GeoLite2-City_20191217.tar.gz');
system('tar -C ../ -xf ../GeoLite2-City_20191217.tar');
copy('../GeoLite2-City_20191217/GeoLite2-City.mmdb', 'addons/sourcemod/configs/geoip/GeoLite2-City.mmdb');
}
else