# HG changeset patch # User dbateman # Date 1180002381 0 # Node ID f4938870a0a72cd796a79e1370645e4571883b0b # Parent 4cce89d792f1205de75587858ddfb009cad91501 [project @ 2007-05-24 10:26:21 by dbateman] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2007-05-24 David Bateman + + * pkg/pkg.m (pkg:rebuild): Thinko in rebuild logic. + 2007-05-22 David Bateman * pkg/pkg.m: Use rethrow(lasterror()) throughout rather than diff --git a/scripts/pkg/pkg.m b/scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -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)