[pacman-dev] [PATCH 0/8] Events
Olivier Brunel
jjk at jjacky.com
Mon Dec 2 15:45:12 EST 2013
The first three patches are just small changes, then goes the update to the
different structs instead of the two void* arguments, and making the log stuff
into an event as well.
Then adding events about creation of the pac* files as originally discussed; And
I've also included a few new events, as mentioned before, that could be useful
to frontends, even though pacman just ignores them (for now).
A couple of other things :
- Andrew mentioned FS#37711, which could be addressed now that those (creation
of pacnew/pacorig files) are fully handled by pacman, but for now I've simply
let those as warnings, much like they were before. Since the color issue has
been fixed (i.e. such messages didn't have colors applied when they were
delayed due to a progress operation) I'm not sure if anything else is really
needed anyways.
- 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).
Olivier Brunel (8):
pacman: Make sure delayed warnings/errors are shown the same
Rename ALPM_EVENT_OPTDEP_REQUIRED to _OPTDEP_REMOVED
alpm: Rename a variable for clarity
Update the event callback
Remove log_cb, add ALPM_EVENT_LOG instead
Add events on pacnew/pacsave/pacorig file creation
Add events ALPM_EVENT_RETRIEVE_{DONE,FAILED}
Add events _PKGDOWNLOAD_{START,DONE,FAILED}
lib/libalpm/add.c | 86 +++++++++++------
lib/libalpm/alpm.h | 248 ++++++++++++++++++++++++++++++++----------------
lib/libalpm/be_sync.c | 6 +-
lib/libalpm/handle.c | 13 ---
lib/libalpm/handle.h | 5 +-
lib/libalpm/log.c | 14 ++-
lib/libalpm/remove.c | 32 +++++--
lib/libalpm/sync.c | 94 +++++++++++++-----
lib/libalpm/util.c | 6 +-
src/pacman/callback.c | 181 ++++++++++++++++++++++++-----------
src/pacman/callback.h | 6 +-
src/pacman/conf.c | 1 -
src/pacman/util.c | 19 +++-
src/pacman/util.h | 1 +
src/util/cleanupdelta.c | 14 +--
src/util/testdb.c | 14 +--
src/util/testpkg.c | 14 +--
17 files changed, 510 insertions(+), 244 deletions(-)
--
1.8.4.2
More information about the pacman-dev
mailing list