changeset 33366:31225b5d494d stable

savepath.m: Correctly handle packages without binaries (bug #65559). * savepath.m: Remove empty strings from list of package paths.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 08 Apr 2024 17:08:51 +0200
parents 1d70b16c216b
children 90fb783da787 a8ce25c80695
files scripts/path/savepath.m
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/path/savepath.m	Mon Apr 08 20:35:50 2024 +0200
+++ b/scripts/path/savepath.m	Mon Apr 08 17:08:51 2024 +0200
@@ -126,6 +126,11 @@
                                 [pkg_user, pkg_system],
                                 "uniformoutput", false)]);
 
+    ## If there are packages without binaries (or without .m files), their
+    ## "archprefix" (or "dir") field might be empty.  Remove empty paths before
+    ## trying to match the regular expression in the next step.
+    pkg_path(cellfun (@isempty, pkg_path)) = [];
+
     ## Rely on Octave's initialization to include the pkg path elements.
     for i_pkg = 1:numel (pkg_path)
       ## Remove all paths that are (sub-)folders of a package folder.