octave-maintainers
[Top][All Lists]
Advanced

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

Re: How to change the autoload status of a single package?


From: Michael Goffioul
Subject: Re: How to change the autoload status of a single package?
Date: Sat, 26 May 2007 22:44:54 +0200

On 5/26/07, David Bateman <address@hidden> wrote:
This is in fact very strange. The call to pkg:rebuild is

     if (global_install)
       global_packages = rebuild (prefix, global_list, files, auto, verbose);
       save (global_list, "global_packages");
       local_packages = global_packages;
     else
       local_packages = rebuild (prefix, local_list, files, auto, verbose);
       save (local_list, "local_packages");
     endif

So if a global installation is detected, the global_list is passed as
the local_list to installed_packages, and then all following operations
in pkg:rebuild are on the global packages. The new structure is then
saved to the correct file immediately on returning from pkg:rebuild.
This is why I want local_list==global_list for this call, as it avoided
some code duplication. It also appears to work fine for me both as a
normal and as a superuser (global install) under linux..

Did you set the prefix for use the "-local" or "-global" flags? Sorry I
can't duplicate this, so can't fix it..

I didn't set any flag. IMO, the problem is not there. As I'm under Windows,
all operations are done as superuser; hence pkg::rebuild gets called with
global_list. Then installed_package gets called with twice global_list (around
line 316). In pkg::installed_package, the first operation (~line 1383)

local_packages = load (local_list).local_packages;

sets local_packages to {}, because the packages contained in local_list
(which is actually global_list) are global; so the field "local_packages"
of the loaded structure is empty. Then the piece of code (~line 1388)

if (strcmp(local_list, global_list))
 global_packages = {};
else
 global_packages = load (global_list).global_packages;
endif

will set global_packages to {} as well, as pkg::installed_packages got
called with twice the same argument; hence local_list==global_list.
In the end, installed_packages returns {}.

Michael.


reply via email to

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