diff scripts/pkg/pkg.m @ 26100:7a8f895c8f15

pkg.m: Don't create 'prefix' directory until needed (bug #53577). * pkg.m: When called with 'prefix' command, only set internal variables prefix and archprefix. Remove calls to mkdir.
author Rik <rik@octave.org>
date Sun, 18 Nov 2018 21:12:41 -0800
parents e9910742d968
children b964092ad9f8
line wrap: on
line diff
--- a/scripts/pkg/pkg.m	Sat Nov 17 02:23:38 2018 -0500
+++ b/scripts/pkg/pkg.m	Sun Nov 18 21:12:41 2018 -0800
@@ -474,25 +474,10 @@
         global_packages = archprefix;
       elseif (numel (files) >= 1 && ischar (files{1}))
         prefix = tilde_expand (files{1});
-        if (! isfolder (prefix))
-          [status, msg] = mkdir (prefix);
-          if (status == 0)
-            error ("pkg: cannot create prefix %s: %s", prefix, msg);
-          endif
-          warning ("pkg: creating the directory %s\n", prefix);
-        endif
-        local_packages = prefix = canonicalize_file_name (prefix);
+        local_packages = prefix = make_absolute_filename (prefix);
         user_prefix = true;
         if (numel (files) >= 2 && ischar (files{2}))
-          archprefix = tilde_expand (files{2});
-          if (! isfolder (archprefix))
-            [status, msg] = mkdir (archprefix);
-            if (status == 0)
-              error ("pkg: cannot create archprefix %s: %s", archprefix, msg);
-            endif
-            warning ("pkg: creating the directory %s\n", archprefix);
-            global_packages = archprefix = canonicalize_file_name (archprefix);
-          endif
+          archprefix = make_absolute_filename (tilde_expand (files{2}));
         endif
       else
         error ("pkg: prefix action requires a directory input, or an output argument");