changeset 6663:f4938870a0a7

[project @ 2007-05-24 10:26:21 by dbateman]
author dbateman
date Thu, 24 May 2007 10:26:21 +0000
parents 4cce89d792f1
children c6e7b03af779
files scripts/ChangeLog scripts/pkg/pkg.m
diffstat 2 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Thu May 24 00:50:33 2007 +0000
+++ b/scripts/ChangeLog	Thu May 24 10:26:21 2007 +0000
@@ -1,3 +1,7 @@
+2007-05-24  David Bateman  <dbateman@free.fr>
+
+        * pkg/pkg.m (pkg:rebuild): Thinko in rebuild logic.
+
 2007-05-22  David Bateman  <dbateman@free.fr>
 
 	* pkg/pkg.m: Use rethrow(lasterror()) throughout rather than
--- a/scripts/pkg/pkg.m	Thu May 24 00:50:33 2007 +0000
+++ b/scripts/pkg/pkg.m	Thu May 24 10:26:21 2007 +0000
@@ -291,7 +291,7 @@
 
     case "rebuild"
       if (global_install)
-	global_packages = rebuild (prefix, global_list, auto, verbose);
+	global_packages = rebuild (prefix, global_list, files,  auto, verbose);
 	save (global_list, "global_packages");
 	local_packages = global_packages;
       else
@@ -315,9 +315,12 @@
   else
     old_descriptions = installed_packages (list, list);
     wd = pwd ();
-    cd (prefix);
-    dirlist = glob (cellfun(@(x) [x, '-*'], files, 'UniformOutput', 0))
-    cd (wd);
+    unwind_protect
+      cd (prefix);
+      dirlist = glob (cellfun(@(x) [x, '-*'], files, 'UniformOutput', 0))
+    unwind_protect_cleanup
+      cd (wd);
+    end_unwind_protect
   endif
   descriptions = {};
   for k = 1:length (dirlist)
@@ -351,10 +354,10 @@
     endif
   endfor
 
-  if (isempty (files))
+  if (! isempty (files))
     ## We are rebuilding for a particular package(s) so we should take
     ## care to keep the other untouched packages in the descriptions
-    descriptions = {desriptions{:}, old_desriptions{:}};
+    descriptions = {descriptions{:}, old_descriptions{:}};
 
     dup = [];
     for i = 1:length (descriptions)