changeset 9220:70177bf9cc16

Fix bug when calling pkg describe to check whether a package is installed
author Carlo de Falco <kingcrimson@tiscali.it>
date Tue, 19 May 2009 15:59:37 +0200
parents 612918b993a0
children 659657942ba6
files scripts/ChangeLog scripts/pkg/pkg.m
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-19 Carlo de Falco  <kingcrimson@tiscali.it>
+
+	* pkg/pkg.m: Fix a bug when quering only one non installed package
+	with "pkg describe".
+
 2009-05-14  Jaroslav Hajek  <highegg@gmail.com>
 
 	* optimization/__fdjac__.m: Support central differences.
--- a/scripts/pkg/pkg.m
+++ b/scripts/pkg/pkg.m
@@ -1000,9 +1000,14 @@
   endfor
 
   non_inst = find (strcmp (flag, "Not installed"));
-  if (! isempty (non_inst) && nargout < 2)
-    non_inst_str = sprintf (" %s ", pkgnames{non_inst});
-    error ("some packages are not installed: %s", non_inst_str);
+  if (! isempty (non_inst))
+    if (nargout < 2)
+      non_inst_str = sprintf (" %s ", pkgnames{non_inst});
+      error ("some packages are not installed: %s", non_inst_str);
+    else
+      pkg_desc_list{non_inst} = struct ("name", {}, "description",  
+					{}, "provides", {});
+    endif
   endif
 
   if (nargout == 0)