Mercurial > hg > octave-lojdl
changeset 10196:69bb6e1e10d2
complement->setdiff in pkg.m
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 23 Jan 2010 06:58:30 +0100 |
parents | b49d47b637b7 |
children | 4d433bd2d4dc |
files | scripts/ChangeLog scripts/pkg/pkg.m |
diffstat | 2 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2010-01-23 Jaroslav Hajek <highegg@gmail.com> + + * pkg/pkg.m: Use setdiff rather than complement. + 2010-01-20 John W. Eaton <jwe@octave.org> * gethelp.cc: Untabfy.
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -664,7 +664,7 @@ error_text = ""; for i = 1:length (descriptions) desc = descriptions{i}; - idx2 = complement (i, 1:length(descriptions)); + idx2 = setdiff (1:length(descriptions), i); if (global_install) ## Global installation is not allowed to have dependencies on locally ## installed packages. @@ -781,12 +781,12 @@ ## Add the packages to the package list. try if (global_install) - idx = complement (packages_to_uninstall, 1:length(global_packages)); + idx = setdiff (1:length(global_packages), packages_to_uninstall); global_packages = save_order ({global_packages{idx}, descriptions{:}}); save (global_list, "global_packages"); installed_pkgs_lst = {local_packages{:}, global_packages{:}}; else - idx = complement (packages_to_uninstall, 1:length(local_packages)); + idx = setdiff (1:length(local_packages), packages_to_uninstall); local_packages = save_order ({local_packages{idx}, descriptions{:}}); save (local_list, "local_packages"); installed_pkgs_lst = {local_packages{:}, global_packages{:}}; @@ -880,7 +880,7 @@ endif ## Compute the packages that will remain installed. - idx = complement (delete_idx, 1:num_packages); + idx = setdiff (1:num_packages, delete_idx); remaining_packages = {installed_pkgs_lst{idx}}; ## Check dependencies.