[pacman-dev] [PATCH 4/8] Update the event callback

Andrew Gregory andrew.gregory.8 at gmail.com
Sun Jan 12 09:33:34 EST 2014


On 01/10/14 at 03:16pm, Olivier Brunel wrote:
> On 01/10/14 14:25, Allan McRae wrote:
> > On 10/01/14 23:14, Olivier Brunel wrote:
> >>
> >> - What's your opinion regarding what I mentioned before:
> >> I don't think addressing FS#36504 was right. This was about moving the
> >> log messages about a package being installed/upgraded/etc before the
> >> scriptlet messages, and not after as they were. I think this might have
> >> been a mistake:
> >> I guess it all depends on when you consider the operation to be
> >> completed, once pacman's extraction reached 100%, or after the scriptlet
> >> have run. I feel the later is right, since they are part of the process
> >> of installing/upgrading/etc a package; Of course, you may disagree.
> >>
> >> Either way, the current situation is wrong, because right now ALPM does:
> >>   1. add log message about the operation being done
> >>   2. run scriptlet
> >>   3. signal frontend (via event) that operation is done
> >>
> >> IOW if a frontend was to actually use the event to present its output to
> >> the user, it wouldn't match the order in the log, which is wrong. This
> >> was done because pacman ignores that event, only showing the progress of
> >> the extraction, and thus people feel that it goes 1. install done; then
> >> 2. scriptlet.
> >>
> >> In fact, pacman doesn't really ignore the event, and uses it to show
> >> (new) optdep. Should this be done before or after the scriptlet?
> >> One could also ask, when using --noprogressbar pacman doesn't say
> >> anything at the end of the operation (save for optdep), imagine it
> >> would: should it be before or after the scriptlet?
> >>
> >> As I said, I think the logging should be moved after the scriptlet have
> >> run, as this is when the operation is really done. If you were to
> >> disagree though, then the event should be moved before the scriptlet
> >> run, to keep consistency between the frontend and the log (which is
> >> broken ATM), but this just feels wrong to me, since then a frontend
> >> would consider a package upgrade/etc done, when in fact the scriptlet
> >> have yet to run (and produce new output relating to the operation
> >> supposedly done).
> > 
> > I'd like Andrew to comment here as I think that was his patch.  I think
> > arguments can be make both ways here.  Maybe signal the frontend it is
> > done installingg at the same time as the log and add signals that
> > install scriptlets are running?  I think this is independent of your
> > patchset, or am I missing something?
> 
> Yeah it is, I did keep things (in) the same (order) and the fix should
> be a separate patch indeed, I just didn't want this to be forgotten is all.

If I understand your proposal, you're suggesting that we *break*
pacman's consistency with the log in order to make it easier for other
front-ends to be consistent with it.  That seems like a step in the
wrong direction if you care about front-end/log consistency.

The reason I moved the logging was really about log integrity.
Resolving FS#36504 was just a happy coincidence.  The log and
front-end output serve two different purposes, and their similarity is
not very important (they aren't even in the same language for
non-English users).  The log should reflect the current state of the
system.  As far as alpm is concerned, the package is installed as soon
as it's added to the local db, so that is the correct time to log it.

I would imagine that users and, by extension, front-ends are generally
more likely to be interested in when the entire installation process,
including scripts, is done.  I would be fine with adding new events as
Allan suggested as long as the end of the entire installation process
can still be reliably detected by the front-end.  Spawning a new
process and running arbitrary code from the packager does seem like
the sort of thing we should be notifying front-ends about anyway.

apg


More information about the pacman-dev mailing list