Mercurial > octave
changeset 28037:f6f9341c46c1
pkg.m: catch non-installed dependencies when unloading a package (bug #57522)
* get-inverse_dependencies.m: if block around potentially empty assignment;
make dependency names comparison case-insensitive
author | Philip Nienhuis <prnienhuis@users.sf.net> |
---|---|
date | Sun, 02 Feb 2020 14:15:30 +0100 |
parents | 465be7c652f1 |
children | a6d57446cdb3 |
files | scripts/pkg/private/get_inverse_dependencies.m |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/pkg/private/get_inverse_dependencies.m Mon Jan 06 09:46:33 2020 +0100 +++ b/scripts/pkg/private/get_inverse_dependencies.m Sun Feb 02 14:15:30 2020 +0100 @@ -41,9 +41,11 @@ pdeps = installed_pkgs_lst{i}.depends; for j = 1:numel (pdeps) pdep_nm = pdeps{j}.package; - if (! strcmp (pdep_nm, "octave")) - idx = cellfun (@(S) strcmp (S.name, pdep_nm), installed_pkgs_lst); - installed_pkgs_lst{idx}.invdeps(end+1) = {installed_pkgs_lst{i}.name}; + if (! strcmpi (pdep_nm, "octave")) + idx = cellfun (@(S) strcmpi (S.name, pdep_nm), installed_pkgs_lst); + if (any (idx)) + installed_pkgs_lst{idx}.invdeps(end+1) = {installed_pkgs_lst{i}.name}; + endif endif endfor endfor