[pacman-dev] [PATCH v2 0/7][WIP] hooks: the sequel
Andrew Gregory
andrew.gregory.8 at gmail.com
Mon Sep 14 22:37:37 UTC 2015
= Changes since v1 =
* file trigger matching has been improved
* sync triggers take noextract into account
* remove triggers will match if a package update removes a file
* remove triggers will not match if the file just moves to another package
* documentation started
* hooks are run after file conflict and diskspace checks
* hooks can be overridden or masked
* hooks are validated after parsing
* system hook directory is relative to the root
* user hook directories can be specified in pacman.conf
= TODO =
* improve documentation
* tests
* compile-time configuration of system directory?
= TODO (deferred) =
* status output
* run order
* allow arguments in Exec
* pass triggering package(s)/file(s) to hook
= RFC =
* Should the system directory be configurable at compile-time? Our other
defaults are configurable, but perhaps this shouldn't be because we expect
packages to be putting files in it.
= Caveats =
* See alpm-hooks.5.txt in the documentation patch for some remaining caveats
regarding file matching.
Aside from the possible configuration of the system hook directory, I consider
this feature-complete for our initial implementation. The remaining TODOs
marked as deferred are non-essential and can be added later with minimal
disruption.
Andrew Gregory (7):
move strtim to util-common
move ini parser into common
check fileconflicts and diskspace outside commit
wip add hooks
add example hooks
start hook documentation
pacman: add user hook directories
doc/.gitignore | 1 +
doc/Makefile.am | 4 +
doc/alpm-hooks.5.txt | 107 ++++++++++++
doc/pacman.conf.5.txt | 8 +
hooks/checkboot.hook | 17 ++
hooks/checkmount | 13 ++
hooks/checkmount.conf | 1 +
hooks/checkmount.hook | 17 ++
hooks/sync.hook | 16 ++
lib/libalpm/Makefile.am | 2 +
lib/libalpm/alpm.c | 7 +-
lib/libalpm/alpm.h | 10 ++
lib/libalpm/handle.c | 59 +++++++
lib/libalpm/handle.h | 1 +
lib/libalpm/hook.c | 443 +++++++++++++++++++++++++++++++++++++++++++++++
lib/libalpm/hook.h | 34 ++++
lib/libalpm/sync.c | 18 +-
lib/libalpm/sync.h | 3 +-
lib/libalpm/trans.c | 12 +-
src/common/ini.c | 116 +++++++++++++
src/common/ini.h | 30 ++++
src/common/util-common.c | 39 +++++
src/common/util-common.h | 2 +
src/pacman/Makefile.am | 2 +
src/pacman/conf.c | 22 +++
src/pacman/conf.h | 1 +
src/pacman/ini.c | 117 +------------
src/pacman/ini.h | 31 +---
src/pacman/util.c | 39 -----
src/pacman/util.h | 1 -
src/util/pactree.c | 36 ----
31 files changed, 980 insertions(+), 229 deletions(-)
create mode 100644 doc/alpm-hooks.5.txt
create mode 100644 hooks/checkboot.hook
create mode 100644 hooks/checkmount
create mode 100644 hooks/checkmount.conf
create mode 100644 hooks/checkmount.hook
create mode 100644 hooks/sync.hook
create mode 100644 lib/libalpm/hook.c
create mode 100644 lib/libalpm/hook.h
create mode 100644 src/common/ini.c
create mode 100644 src/common/ini.h
mode change 100644 => 120000 src/pacman/ini.c
mode change 100644 => 120000 src/pacman/ini.h
--
2.5.2
More information about the pacman-dev
mailing list