[sugar] [PATCH] Avoid duplicates in the bundle registry
Tomeu Vizoso
tomeu
Wed May 28 04:46:45 EDT 2008
On Tue, May 27, 2008 at 6:44 PM, Michael Stone <michael at laptop.org> wrote:
> On Tue, May 27, 2008 at 09:15:39AM +0200, Tomeu Vizoso wrote:
>> + for bundle in self._bundles:
>> + if new_bundle.get_bundle_id() == bundle.get_bundle_id():
>
> Why are we performing repeated linear search instead of storing bundles
> in a datastructure with sub-linear containment lookups (e.g. a set or a
> hashtable)?
Because the patch is simpler this way. Why do you think that using a
set or a table might be better here?
>> + if new_bundle.get_activity_version() <= bundle.get_activity_version():
>
> Why exclude old bundle versions?
Eben's new design makes very clear that several versions of the same
bundle need to be installed and the user can manage them as wanted.
When I started implementing this some months ago, I found some
problems with identifying bundles other than by its bundle_id. See:
http://lists.laptop.org/pipermail/sugar/2008-April/004893.html
I even proposed some patches that partially address this:
http://lists.laptop.org/pipermail/sugar/2008-April/004894.html
http://lists.laptop.org/pipermail/sugar/2008-April/004895.html
http://lists.laptop.org/pipermail/sugar/2008-April/004896.html
Those patches were not reviewed because it was considered better to
wait for the discussion about bundle identification to be settled.
In the meantime, the UI is showing several icons for the same bundle,
so this patch addresses those inconsistencies while we wait for a real
solution. As you know, it has already been pointed several flaws on
the shell redesign that in reality were just bugs or unimplemented
parts, so I'm trying to keep things more or less sane so we get better
feedback.
> Have you reviewed any of the bundle commentaries that Eben, Jameson, and
> I have been writing?
>
> http://wiki.laptop.org/go/User:Mstone/Commentaries/Bundles_1
> http://wiki.laptop.org/go/User:Mstone/Commentaries/Bundles_2
Haven't had time to fully read. Can someone summarize the conclusion?
Thanks,
Tomeu
More information about the Sugar-devel
mailing list