octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small bug in "pkg rebuild"


From: David Bateman
Subject: Small bug in "pkg rebuild"
Date: Thu, 24 May 2007 01:55:05 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

There is a smal bug in "pkg rebuild" in 2.9.12, which basically means it
can work as promised. It will only work correctly for locally installed
files and only if all installed files are listed. The attached fix
addresses this.

I believe this only affects Michael for his MSVC packaging and so he can
apply the patch in his package, so this is not a showstopper for the
package manager.

2007-05-24  David Bateman  <address@hidden>

        * pkg/pkg.m (pkg:rebuild): Thinko in rebuild logic.
Index: scripts/pkg/pkg.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/pkg/pkg.m,v
retrieving revision 1.46
diff -u -r1.46 pkg.m
--- scripts/pkg/pkg.m   22 May 2007 19:25:29 -0000      1.46
+++ scripts/pkg/pkg.m   23 May 2007 23:49:51 -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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]