Mercurial > hg > octave-nkf
comparison scripts/pkg/private/install.m @ 14470:aad7ad0e15c1
maint: Remove redundant private function from the package manager.
* pkg/private/isautoload.m: remove file.
* pkg/private/install.m: remove calls to isautoload.
author | Carlo de Falco <kingcrimson@tiscali.it> |
---|---|
date | Fri, 16 Mar 2012 18:54:34 +0100 |
parents | cfb0173fe1ca |
children | d2c095e45196 |
comparison
equal
deleted
inserted
replaced
14469:29aabe9b37a2 | 14470:aad7ad0e15c1 |
---|---|
257 endif | 257 endif |
258 endfor | 258 endfor |
259 | 259 |
260 ## If the package requested that it is autoloaded, or the installer | 260 ## If the package requested that it is autoloaded, or the installer |
261 ## requested that it is, then mark the package as autoloaded. | 261 ## requested that it is, then mark the package as autoloaded. |
262 str_true = {"true", "on", "yes", "1"}; | |
262 for i = length (descriptions):-1:1 | 263 for i = length (descriptions):-1:1 |
263 if (autoload > 0 || (autoload == 0 && isautoload (descriptions(i)))) | 264 |
265 desc_autoload = false; | |
266 if (isfield (descriptions{i}, "autoload")) | |
267 a = descriptions{i}.autoload; | |
268 desc_autoload = ((isnumeric (a) && a > 0) | |
269 || (ischar (a) | |
270 && any (strcmpi (a, str_true)))); | |
271 endif | |
272 | |
273 if (autoload > 0 || desc_autoload) | |
264 fclose (fopen (fullfile (descriptions{i}.dir, "packinfo", | 274 fclose (fopen (fullfile (descriptions{i}.dir, "packinfo", |
265 ".autoload"), "wt")); | 275 ".autoload"), "wt")); |
266 descriptions{i}.autoload = 1; | 276 descriptions{i}.autoload = 1; |
267 endif | 277 else |
278 descriptions{i}.autoload = 0; | |
279 endif | |
280 | |
268 endfor | 281 endfor |
269 | 282 |
270 ## Add the packages to the package list. | 283 ## Add the packages to the package list. |
271 try | 284 try |
272 if (global_install) | 285 if (global_install) |
307 ## Add the newly installed packages to the path, so the user | 320 ## Add the newly installed packages to the path, so the user |
308 ## can begin using them. Only load them if they are marked autoload. | 321 ## can begin using them. Only load them if they are marked autoload. |
309 if (length (descriptions) > 0) | 322 if (length (descriptions) > 0) |
310 idx = []; | 323 idx = []; |
311 for i = 1:length (descriptions) | 324 for i = 1:length (descriptions) |
312 if (isautoload (descriptions(i))) | 325 if (descriptions{i}.autoload > 0) |
313 nm = descriptions{i}.name; | 326 nm = descriptions{i}.name; |
314 for j = 1:length (installed_pkgs_lst) | 327 for j = 1:length (installed_pkgs_lst) |
315 if (strcmp (nm, installed_pkgs_lst{j}.name)) | 328 if (strcmp (nm, installed_pkgs_lst{j}.name)) |
316 idx (end + 1) = j; | 329 idx (end + 1) = j; |
317 break; | 330 break; |