[sabayon] What happens when a profile is saved?



My mental model of what happens at the end of a sabayon profile editing
session when the user invokes the "save" menu items is this, please
correct me if I'm wrong.

1) Every change that had been registered with emit_change is iterated
over and commit_change is called for that change. storage.add() might be
called in commit_change if the change is a file object. Depending on the
nature of the change (e.g. mandatory) it might be "grouped" into
different files for step 2.

2) Every source module is iterated over and sync_change is called for
that module. storage.add() might be called in sync_change if committed
changes from step 1 are grouped together into a single file.

3) The storage module is invoked saving the files that were added by
storage.add in either step 1 or step 2 into one persistent collection
(e.g. zip file).

Did I get that right?

At the moment (perhaps in a moment I'll have an epiphany) I've got a
stumbling block because delegates don't seem to fit into this model.
Perhaps its because I have a misunderstanding of the source/delegate
relationship or perhaps its just because I'm doing something new and we
just need to add some code to support it.

Here's the problem, delegates are invoked for commit_change and apply,
thats good. Delegates are not invoked for sync_change. Only sources have
a sync_change method and only sources are invoked for sync_change and
sources don't iterate over their delegates during sync_change. Why are
delegates invoked for commit_change and apply but not for sync_change?
Is that by design or omission?

Do I have a misunderstanding of the architecture? As I've implemented
things so far mozilla is a delegate of FilesSource and mozilla needs to
collect its changes and write them out, I think this should be happening
in mozilla's sync_change (right?). But as a delegate mozilla doesn't
have an opportunity to perform a sync_change (or maybe I just missed
it).


-- 
John Dennis <jdennis redhat com>




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