Mercurial > hg > octave-nkf
diff scripts/pkg/pkg.m @ 18641:4daf647c86c3 gui-release
Implement pkg update pkgnametoupdate (Bug #41732)
* scripts/pkg/pkg.m: on update command use list of file names to update when available.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Tue, 11 Mar 2014 21:15:06 -0400 |
parents | d63878346099 |
children | cd83730e5e38 fe689210525c |
line wrap: on
line diff
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -540,6 +540,23 @@ case "update" if (nargout == 0) installed_pkgs_lst = installed_packages (local_list, global_list); + if (length (files) > 0) + update_lst = {}; + for i = 1:length (files) + is_installed = false; + for j = 1:length (installed_pkgs_lst) + if (strcmp (files{i}, installed_pkgs_lst{j}.name)) + update_lst = { update_lst{:}, installed_pkgs_lst{j} }; + is_installed = true; + endif + endfor + if (is_installed == false) + s = sprintf ("Package %s is not installed - not updating this package", files{i}); + warning (s); + endif + endfor + installed_pkgs_lst = update_lst; + endif for i = 1:length (installed_pkgs_lst) installed_pkg_name = installed_pkgs_lst{i}.name; installed_pkg_version = installed_pkgs_lst{i}.version;