summaryrefslogtreecommitdiff
blob: a72ac97c0a1536dd9c69bb9b5686cee95c4b44b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- a/scripts/pkg/private/install.m
+++ b/scripts/pkg/private/install.m
@@ -62,7 +62,14 @@
     for i = 1:length (files)
       tgz = files{i};
 
-      if (exist (tgz, "file"))
+      ## The filename pointed to an uncompressed package to begin with.
+      if (exist (tgz, "dir"))
+        if (tgz(1) == '/')
+          packdir = tgz;
+        else
+          packdir = fullfile (pwd(), tgz);
+        endif
+      elseif (exist (tgz, "file"))
         ## Create a temporary directory.
         tmpdir = tempname ();
         tmpdirs{end+1} = tmpdir;
@@ -89,20 +96,12 @@
         if (length (dirlist) > 3)
           error ("bundles of packages are not allowed");
         endif
-      endif
 
-      ## The filename pointed to an uncompressed package to begin with.
-      if (exist (tgz, "dir"))
-        dirlist = {".", "..", tgz};
+        ## The two first entries of dirlist are "." and "..".
+        packdir = fullfile (tmpdir, dirlist{3});
       endif
 
       if (exist (tgz, "file") || exist (tgz, "dir"))
-        ## The two first entries of dirlist are "." and "..".
-        if (exist (tgz, "file"))
-          packdir = fullfile (tmpdir, dirlist{3});
-        else
-          packdir = fullfile (pwd (), dirlist{3});
-        endif
         packdirs{end+1} = packdir;
 
         ## Make sure the package contains necessary files.