File: octave-pkgbuilddir.patch

package info (click to toggle)
octave 10.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 145,276 kB
  • sloc: cpp: 335,864; ansic: 82,242; fortran: 20,963; objc: 9,396; sh: 8,713; yacc: 4,392; lex: 4,327; perl: 1,544; java: 1,366; awk: 1,259; makefile: 656; xml: 191
file content (46 lines) | stat: -rw-r--r-- 1,586 bytes parent folder | download | duplicates (4)
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
42
43
44
45
46
Description: Allow an unpacked source package to be compiled in place
Author: Rafael Laboissière <rafael@debian.org>
Origin: vendor, http://pkgs.fedoraproject.org/cgit/rpms/octave.git/tree/octave-pkgbuilddir.patch
Forwarded: not-needed
Last-Update: 2016-02-13

--- a/scripts/pkg/private/install.m
+++ b/scripts/pkg/private/install.m
@@ -74,7 +74,10 @@ function install (files, handle_deps, pr
     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;
@@ -109,17 +112,16 @@ function install (files, handle_deps, pr
         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;