[GSoC] migration

Jackson Isaac ijackson at macports.org
Sun Aug 6 13:13:08 UTC 2017


Hi,

On Sun, Aug 6, 2017 at 5:41 PM, Umesh Singla <umeshksingla at macports.org> wrote:
> On Sat, Jul 22, 2017 at 7:26 AM, Joshua Root <jmr at macports.org> wrote:
>>
>>
>>> For now, I'd like to ask in what order does "registry::entry imaged"
>>> returns the port list? Because I'm running the sorting function which the
>>> restore_ports.tcl uses but it's giving me the ports in the same order as
>>> result.
>>
>>
>> Probably just ordered by rowid, i.e. might as well be random. Note that
>> the sort_ports proc from restore_ports.tcl does not take a list of registry
>> references like registry::entry returns, but a list of strings representing
>> port names, versions and variants in the format generated by 'port
>> installed'.
>
>
> `port installed` returns the result of `registry::entry imaged` sorted in an
> alphabetical order, first by name, then version etc.
>
> `registry::entry imaged` might be returning in a random order but sorting it
> (with ports coming before their dependencies) doesn't change the result at
> all.
>

[1] and [2] might be useful. The list of ports are passed to
_mportexec after topologically sorting them for installing. This might
also answer some of your previous queries regarding using [mportexec
$workername $install_target] and sorting the dependencies at once.

Variants is still pending. You could try to integrate sorting and
installation of ports with libsolv and extend variant handling from
your script. You might have to tweak the libsolv code if you pass the
variants like foo+bar-baz. One idea could be to add 'bar' as
dependency and 'baz' as conflict explicitly since it will only read
the portindex for 'foo'.

Libsolv proved to be faster than our traditional recursive dependency
calculation engine even after reading through the complete portindex
every time it was called.

Let me know if you have any doubts regarding the libsolv code. The
comments should be explanatory enough by itself but feel free if you
want to understand what is actually happening behind the scenes by
libsolv.

If interested, you could check [3] for setting up libsolv branch and
testing/reusing the code with yours. You could prepare one for yours
too, since final evaluation and submission is coming up soon.

[1] https://github.com/macports/macports-base/blob/gsoc15-dependency/src/macports1.0/macports_libsolv.tcl#L474

[2] https://github.com/macports/macports-base/blob/gsoc15-dependency/src/macports1.0/macports.tcl#L2035

[3] https://trac.macports.org/wiki/SummerOfCode2015Libsolv

-- 
Jackson Isaac


More information about the macports-dev mailing list