Allow an unpacked source package to be compiled in place
authorRafael Laboissière <rafael@debian.org>
Wed, 20 May 2020 20:43:17 +0000 (21:43 +0100)
committerSébastien Villemot <sebastien@debian.org>
Wed, 20 May 2020 20:43:17 +0000 (21:43 +0100)
Origin: vendor, http://pkgs.fedoraproject.org/cgit/rpms/octave.git/tree/octave-pkgbuilddir.patch
Forwarded: not-needed
Last-Update: 2016-02-13

Gbp-Pq: Name octave-pkgbuilddir.patch

scripts/pkg/private/install.m

index ef8131ed4d5069d2d5774d8d327735501365c0d1..8fd3dc133dd0f67be5fadb5c3529c2d66414def2 100644 (file)
@@ -62,7 +62,10 @@ function install (files, handle_deps, prefix, archprefix, verbose,
     for i = 1:length (files)
       tgz = files{i};
 
-      if (exist (tgz, "file"))
+      ## The filename pointed to an uncompressed package to begin with.
+      if (isfolder (tgz))
+        dirlist = {".", "..", tgz};
+      elseif (exist (tgz, "file"))
         ## Create a temporary directory.
         tmpdir = tempname ();
         tmpdirs{end+1} = tmpdir;
@@ -97,17 +100,16 @@ function install (files, handle_deps, prefix, archprefix, verbose,
         endif
       endif
 
-      ## The filename pointed to an uncompressed package to begin with.
-      if (isfolder (tgz))
-        dirlist = {".", "..", tgz};
-      endif
-
-      if (exist (tgz, "file") || isfolder (tgz))
+      if (exist (tgz, "file"))
         ## The two first entries of dirlist are "." and "..".
-        if (exist (tgz, "file"))
-          packdir = fullfile (tmpdir, dirlist{3});
+        if (exist (tgz, "dir"))
+          if (tgz(1) == '/')
+            packdir = tgz;
+          else
+            packdir = fullfile (pwd (), dirlist{3});
+          endif
         else
-          packdir = fullfile (pwd (), dirlist{3});
+          packdir = fullfile (tmpdir, dirlist{3});
         endif
         packdirs{end+1} = packdir;