Skip to content

Commit 625ac96

Browse files
committed
In packaging, use API for gunzip instead of executable (bug 6415).
1 parent 68ac27e commit 625ac96

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/buildbot/package.pl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use File::Basename;
66
use File::stat;
77
use Net::FTP;
8+
use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
89
use Time::localtime;
910

1011
my ($ftp_file, $ftp_host, $ftp_user, $ftp_pass, $ftp_path, $tag);
@@ -78,8 +79,17 @@
7879
print "Reusing existing GeoIP.dat\n";
7980
}
8081

81-
system('gunzip -c ../GeoIP.dat.gz > addons/sourcemod/configs/geoip/GeoIP.dat');
82+
my $geoIPfile = 'addons/sourcemod/configs/geoip/GeoIP.dat';
83+
if (-e $geoIPfile) {
84+
unlink($geoIPfile);
85+
}
8286

87+
open(my $fh, ">", $geoIPfile)
88+
or die "cannot open $geoIPfile for writing: $!";
89+
binmode($fh);
90+
gunzip '../GeoIP.dat.gz' => $fh
91+
or die "gunzip failed: $GunzipError\n";
92+
close($fh);
8393

8494
my ($version);
8595

0 commit comments

Comments
 (0)