Commit eb7d7ef8 authored by Alexandre Julliard's avatar Alexandre Julliard

unicode: Read data files from inside the zip without extracting them.

parent dec6f077
......@@ -436,26 +436,28 @@ sub open_data_file($$)
my ($base, $name) = @_;
(my $dir = "data/$name") =~ s/\/[^\/]+$//;
local *FILE;
unless (-f "data/$name")
{
system "mkdir", "-p", $dir;
if ($base =~ /.*\/([^\/]+\.zip)$/)
if ($base =~ /.*\/([^\/]+)\.zip$/)
{
my $zip = $1;
unless (-f "data/$zip")
{
mkdir "data";
print "Fetching $base...\n";
!system "wget", "-q", "-O", "data/$zip", "$base" or die "cannot fetch $base";
!system "wget", "-q", "-O", "data/$zip", $base or die "cannot fetch $base";
}
!system "unzip", "-q", "-d", "data", "data/$zip", $name or die "cannot extract $name from $zip";
open FILE, "-|", "unzip", "-p", "data/$zip", $name or die "cannot extract $name from $zip";
}
else
{
unless (-f "data/$name")
{
system "mkdir", "-p", $dir;
print "Fetching $base/$name...\n";
!system "wget", "-q", "-O", "data/$name", "$base/$name" or die "cannot fetch $base/$name";
}
}
open FILE, "<data/$name" or die "cannot open data/$name";
}
return *FILE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment