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

Alexandre Julliard julliard at winehq.org
Fri Mar 13 15:24:44 CDT 2020


Module: wine
Branch: master
Commit: eb7d7ef86383c8ae1986876d8247ea9abfc27096
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=eb7d7ef86383c8ae1986876d8247ea9abfc27096

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Mar 13 11:55:59 2020 +0100

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

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/make_unicode | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/tools/make_unicode b/tools/make_unicode
index 60ca333a4f..ca7842c654 100755
--- a/tools/make_unicode
+++ b/tools/make_unicode
@@ -436,26 +436,28 @@ sub open_data_file($$)
     my ($base, $name) = @_;
     (my $dir = "data/$name") =~ s/\/[^\/]+$//;
     local *FILE;
-    unless (-f "data/$name")
+
+    if ($base =~ /.*\/([^\/]+)\.zip$/)
     {
-        system "mkdir", "-p", $dir;
-        if ($base =~ /.*\/([^\/]+\.zip)$/)
+        my $zip = $1;
+        unless (-f "data/$zip")
         {
-            my $zip = $1;
-            unless (-f "data/$zip")
-            {
-                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";
+            mkdir "data";
+            print "Fetching $base...\n";
+            !system "wget", "-q", "-O", "data/$zip", $base or die "cannot fetch $base";
         }
-        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";
             !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;
 }
 




More information about the wine-cvs mailing list