Mercurial > hg > octave-lyh
comparison 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 |
comparison
equal
deleted
inserted
replaced
6662:4cce89d792f1 | 6663:f4938870a0a7 |
---|---|
289 error ("you must specify a global_list file, or request an output argument"); | 289 error ("you must specify a global_list file, or request an output argument"); |
290 endif | 290 endif |
291 | 291 |
292 case "rebuild" | 292 case "rebuild" |
293 if (global_install) | 293 if (global_install) |
294 global_packages = rebuild (prefix, global_list, auto, verbose); | 294 global_packages = rebuild (prefix, global_list, files, auto, verbose); |
295 save (global_list, "global_packages"); | 295 save (global_list, "global_packages"); |
296 local_packages = global_packages; | 296 local_packages = global_packages; |
297 else | 297 else |
298 local_packages = rebuild (prefix, local_list, files, auto, verbose); | 298 local_packages = rebuild (prefix, local_list, files, auto, verbose); |
299 save (local_list, "local_packages"); | 299 save (local_list, "local_packages"); |
313 ## the two first entries of dirlist are "." and ".." | 313 ## the two first entries of dirlist are "." and ".." |
314 dirlist([1,2]) = []; | 314 dirlist([1,2]) = []; |
315 else | 315 else |
316 old_descriptions = installed_packages (list, list); | 316 old_descriptions = installed_packages (list, list); |
317 wd = pwd (); | 317 wd = pwd (); |
318 cd (prefix); | 318 unwind_protect |
319 dirlist = glob (cellfun(@(x) [x, '-*'], files, 'UniformOutput', 0)) | 319 cd (prefix); |
320 cd (wd); | 320 dirlist = glob (cellfun(@(x) [x, '-*'], files, 'UniformOutput', 0)) |
321 unwind_protect_cleanup | |
322 cd (wd); | |
323 end_unwind_protect | |
321 endif | 324 endif |
322 descriptions = {}; | 325 descriptions = {}; |
323 for k = 1:length (dirlist) | 326 for k = 1:length (dirlist) |
324 descfile = fullfile (prefix, dirlist{k}, "packinfo", "DESCRIPTION"); | 327 descfile = fullfile (prefix, dirlist{k}, "packinfo", "DESCRIPTION"); |
325 if (verbose) | 328 if (verbose) |
349 elseif (verbose) | 352 elseif (verbose) |
350 warning ("directory %s is not a valid package", dirlist{k}); | 353 warning ("directory %s is not a valid package", dirlist{k}); |
351 endif | 354 endif |
352 endfor | 355 endfor |
353 | 356 |
354 if (isempty (files)) | 357 if (! isempty (files)) |
355 ## We are rebuilding for a particular package(s) so we should take | 358 ## We are rebuilding for a particular package(s) so we should take |
356 ## care to keep the other untouched packages in the descriptions | 359 ## care to keep the other untouched packages in the descriptions |
357 descriptions = {desriptions{:}, old_desriptions{:}}; | 360 descriptions = {descriptions{:}, old_descriptions{:}}; |
358 | 361 |
359 dup = []; | 362 dup = []; |
360 for i = 1:length (descriptions) | 363 for i = 1:length (descriptions) |
361 if (find (dup, i)) | 364 if (find (dup, i)) |
362 continue; | 365 continue; |