changeset 31132:cf5f46b2e052 stable

pkg: Replace OCTAVE_HOME in PREFIX and ARCHPREFIX independently (bug #62681). * scripts/pkg/private/expand_rel_paths.m: The PREFIX and ARCHPREFIX might point to directories outside OCTAVE_HOME independently. Also only replace "__OH__" if it is at the start of the respective strings.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 08 Jul 2022 12:57:22 +0200
parents 65c4d98352d3
children f8d3c0f035d0 8245e773bb5b
files scripts/pkg/private/expand_rel_paths.m
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/pkg/private/expand_rel_paths.m	Fri Jul 08 12:46:37 2022 +0200
+++ b/scripts/pkg/private/expand_rel_paths.m	Fri Jul 08 12:57:22 2022 +0200
@@ -34,10 +34,9 @@
   loc = OCTAVE_HOME ();
   for i = 1:numel (pkg_list)
     ## Be sure to only prepend OCTAVE_HOME to pertinent package paths
-    if (strncmpi (pkg_list{i}.dir, "__OH__", 6))
-      pkg_list{i}.dir = [ loc pkg_list{i}.dir(7:end) ];
-      pkg_list{i}.archprefix = [ loc pkg_list{i}.archprefix(7:end) ];
-    endif
+    pkg_list{i}.dir = regexprep (pkg_list{i}.dir, "^__OH__", loc);
+    pkg_list{i}.archprefix = regexprep (pkg_list{i}.archprefix, ...
+                                        "^__OH__", loc);
   endfor
 
 endfunction