# HG changeset patch # User dbateman # Date 1179150994 0 # Node ID 66e30383481bf8d73215e8729ded9450dc224558 # Parent 687ae48b2253e178888826653d86fb26d6c64cc6 [project @ 2007-05-14 13:56:34 by dbateman] diff -r 687ae48b2253 -r 66e30383481b doc/ChangeLog --- a/doc/ChangeLog Sun May 13 06:24:58 2007 +0000 +++ b/doc/ChangeLog Mon May 14 13:56:34 2007 +0000 @@ -1,3 +1,7 @@ +2007-04-18 Søren Hauberg + + * interpreter/package.texi: Document "*" flag for loaded packages. + 2007-05-09 David Bateman * faq/Octave-FAQ.texi: Update compatibility section. diff -r 687ae48b2253 -r 66e30383481b doc/interpreter/package.txi --- a/doc/interpreter/package.txi Sun May 13 06:24:58 2007 +0000 +++ b/doc/interpreter/package.txi Mon May 14 13:56:34 2007 +0000 @@ -49,15 +49,16 @@ @example @group pkg list - @print{} Package Name | Version | Installation directory - @print{} -------------+---------+----------------------- - @print{} image | 1.0.0 | /home/jwe/octave/image-1.0.0 + @print{} Package Name | Version | Installation directory + @print{} --------------+---------+----------------------- + @print{} image *| 1.0.0 | /home/jwe/octave/image-1.0.0 @end group @end example @noindent In this case only version 1.0.0 of the @code{image} package is -installed. +installed. The '*' character next to the package name shows that the +image package is loaded and ready for use. It is possible to remove a package from the system using the @code{pkg uninstall} command like this diff -r 687ae48b2253 -r 66e30383481b scripts/ChangeLog --- a/scripts/ChangeLog Sun May 13 06:24:58 2007 +0000 +++ b/scripts/ChangeLog Mon May 14 13:56:34 2007 +0000 @@ -1,3 +1,7 @@ +2007-05-14 David Bateman + + * pkg/pkg.m: Mark loaded packages with "*". + 2007-05-13 Søren Hauberg * miscellaneous/single.m: Doc fix. diff -r 687ae48b2253 -r 66e30383481b scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Sun May 13 06:24:58 2007 +0000 +++ b/scripts/pkg/pkg.m Mon May 14 13:56:34 2007 +0000 @@ -45,7 +45,7 @@ ## automatically load the installed package when starting Octave, ## even if the package requests that it isn't. ## -## Final if @var{option} is @code{-verbose} the package manager will +## Finally, if @var{option} is @code{-verbose} the package manager will ## print the output of all of the commands that are performed ## @item uninstall ## Uninstall named packages. For example, @@ -1238,6 +1238,16 @@ installed_packages(dup) = []; endif + ## Now check if the package is loaded + tmppath = path(); + for i = 1:length (installed_packages) + if (regexp (tmppath, installed_packages{i}.dir)) + installed_packages{i}.loaded = true; + else + installed_packages{i}.loaded = false; + endif + endfor + ## Should we return something? if (nargout == 2) out1 = local_packages; @@ -1269,7 +1279,7 @@ length (installed_packages{i}.version)); names{i} = installed_packages{i}.name; endfor - h1 = postpad (h1, max_name_length, " "); + h1 = postpad (h1, max_name_length + 1, " "); h2 = postpad (h2, max_version_length, " ");; ## Print a header @@ -1281,14 +1291,19 @@ printf ("%s\n", tmp); ## Print the packages - format = sprintf ("%%%ds | %%%ds | %%s\n", max_name_length, + format = sprintf ("%%%ds %%1s| %%%ds | %%s\n", max_name_length, max_version_length); [dummy, idx] = sort (names); for i = 1:num_packages cur_name = installed_packages{idx(i)}.name; cur_version = installed_packages{idx(i)}.version; cur_dir = installed_packages{idx(i)}.dir; - printf (format, cur_name, cur_version, cur_dir); + if (installed_packages{idx(i)}.loaded) + cur_loaded = "*"; + else + cur_loaded = " "; + endif + printf (format, cur_name, cur_loaded, cur_version, cur_dir); endfor endfunction