diff scripts/pkg/private/install.m @ 26812:0dd5b293b18c stable

pkg.m: restore installing packages from zip archives (bug #55788) * install.m: Call unzip on package archive if the file name ends in .zip, untar on any other file. This restores installation from .zip, in previous versions the untar function silently handled any archive format.
author Mike Miller <mtmiller@octave.org>
date Thu, 28 Feb 2019 20:40:09 -0800
parents 00f796120a6d
children 29ccef7e5295
line wrap: on
line diff
--- a/scripts/pkg/private/install.m	Fri Feb 01 22:16:15 2019 -0800
+++ b/scripts/pkg/private/install.m	Thu Feb 28 20:40:09 2019 -0800
@@ -75,10 +75,16 @@
         endif
 
         ## Uncompress the package.
+        [~, ~, ext] = fileparts (tgz);
+        if (strcmpi (ext, ".zip"))
+          func_uncompress = @unzip;
+        else
+          func_uncompress = @untar;
+        endif
         if (verbose)
-          printf ("untar (%s, %s)\n", tgz, tmpdir);
+          printf ("%s (%s, %s)\n", func2str (func_uncompress), tgz, tmpdir);
         endif
-        untar (tgz, tmpdir);
+        func_uncompress (tgz, tmpdir);
 
         ## Get the name of the directories produced by tar.
         [dirlist, err, msg] = readdir (tmpdir);