diff scripts/pkg/pkg.m @ 6663:f4938870a0a7

[project @ 2007-05-24 10:26:21 by dbateman]
author dbateman
date Thu, 24 May 2007 10:26:21 +0000
parents 8dda89ca38f6
children f938c7018d28
line wrap: on
line diff
--- 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)