mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 09:50:52 +00:00
unicode: Read data files from inside the zip without extracting them.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dec6f0773b
commit
eb7d7ef863
1 changed files with 14 additions and 12 deletions
|
@ -436,26 +436,28 @@ sub open_data_file($$)
|
||||||
my ($base, $name) = @_;
|
my ($base, $name) = @_;
|
||||||
(my $dir = "data/$name") =~ s/\/[^\/]+$//;
|
(my $dir = "data/$name") =~ s/\/[^\/]+$//;
|
||||||
local *FILE;
|
local *FILE;
|
||||||
unless (-f "data/$name")
|
|
||||||
|
if ($base =~ /.*\/([^\/]+)\.zip$/)
|
||||||
{
|
{
|
||||||
system "mkdir", "-p", $dir;
|
my $zip = $1;
|
||||||
if ($base =~ /.*\/([^\/]+\.zip)$/)
|
unless (-f "data/$zip")
|
||||||
{
|
{
|
||||||
my $zip = $1;
|
mkdir "data";
|
||||||
unless (-f "data/$zip")
|
print "Fetching $base...\n";
|
||||||
{
|
!system "wget", "-q", "-O", "data/$zip", $base or die "cannot fetch $base";
|
||||||
print "Fetching $base...\n";
|
|
||||||
!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";
|
|
||||||
}
|
}
|
||||||
else
|
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";
|
print "Fetching $base/$name...\n";
|
||||||
!system "wget", "-q", "-O", "data/$name", "$base/$name" or die "cannot fetch $base/$name";
|
!system "wget", "-q", "-O", "data/$name", "$base/$name" or die "cannot fetch $base/$name";
|
||||||
}
|
}
|
||||||
|
open FILE, "<data/$name" or die "cannot open data/$name";
|
||||||
}
|
}
|
||||||
open FILE, "<data/$name" or die "cannot open data/$name";
|
|
||||||
return *FILE;
|
return *FILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue