[pacman-dev] [PATCH v3 00/11] hooks v3 - now with 60% less fail

Andrew Gregory andrew.gregory.8 at gmail.com
Sat Oct 17 00:28:22 UTC 2015


= Changes since v2 =
  * separate INSTALL/UPGRADE trigger types
  * triggers can contain multiple operation fields
  * allow Exec fields to contain arguments (as well as a few shell features
    courtesy of wordexp(3))
  * tests
  * make system hook directory relative to datarootdir
  * improved documentation
  * removed example hooks, they can still be found at:
    https://github.com/andrewgregory/libalpm-hooks

= TODO (deferred) =                                                                                                                                            
  * status output                                                                                                                                              
  * run order                                                                                                                                                  
  * pass triggering package(s)/file(s) to hook

= Trigger Matching =

The new install/upgrade/remove filtering to support separate install/upgrade
triggers requires building complete lists of all files being installed and
removed and comparing them to each other to determine the actual final
disposition of all files.  Given the new additional complexity, I have removed
some of the optimizations from the previous version.  I never benchmarked the
previous version, so I don't know how much of a performance hit this was, but
in the tests I ran this is still fast enough that I'm not inclined to try to
add them back just yet.  With a transaction that included 682 packages and
~150,000 files, a hook with a single '*' file trigger matched its targets and
ran in ~0.15s.

Andrew Gregory (11):
  handle: add hookdirs option
  add hook data types and parser
  run hooks during trans_commit
  validate hooks after parsing
  pacman: add user hook directories
  pactest: use pacman --hookdir option
  util.py: return the created path
  pactest: add hook/script support
  add hook tests
  add alpm-hooks man page
  allow arguments in hook Exec fields

 doc/.gitignore                                     |   1 +
 doc/Makefile.am                                    |   4 +
 doc/alpm-hooks.5.txt                               | 117 +++++
 doc/pacman.conf.5.txt                              |   8 +
 lib/libalpm/Makefile.am                            |   3 +
 lib/libalpm/alpm.c                                 |   5 +
 lib/libalpm/alpm.h                                 |  10 +
 lib/libalpm/error.c                                |   2 +
 lib/libalpm/handle.c                               |  59 +++
 lib/libalpm/handle.h                               |   1 +
 lib/libalpm/hook.c                                 | 504 +++++++++++++++++++++
 lib/libalpm/hook.h                                 |  34 ++
 lib/libalpm/ini.c                                  |   1 +
 lib/libalpm/ini.h                                  |   1 +
 lib/libalpm/trans.c                                |   6 +
 src/pacman/Makefile.am                             |   2 +
 src/pacman/conf.c                                  |  22 +
 src/pacman/conf.h                                  |   2 +
 src/pacman/pacman.c                                |  10 +
 test/pacman/pmfile.py                              |  27 +-
 test/pacman/pmpkg.py                               |   3 +-
 test/pacman/pmtest.py                              |  30 +-
 test/pacman/tests/TESTS                            |  10 +
 test/pacman/tests/hook-abortonfail.py              |  25 +
 test/pacman/tests/hook-exec-with-arguments.py      |  22 +
 test/pacman/tests/hook-file-change-packages.py     |  32 ++
 .../pacman/tests/hook-file-remove-trigger-match.py |  24 +
 test/pacman/tests/hook-file-upgrade-nomatch.py     |  27 ++
 test/pacman/tests/hook-invalid-trigger.py          |  25 +
 .../pacman/tests/hook-pkg-install-trigger-match.py |  23 +
 test/pacman/tests/hook-pkg-remove-trigger-match.py |  23 +
 .../pacman/tests/hook-pkg-upgrade-trigger-match.py |  26 ++
 test/pacman/tests/hook-upgrade-trigger-no-match.py |  23 +
 test/pacman/util.py                                |   5 +-
 34 files changed, 1107 insertions(+), 10 deletions(-)
 create mode 100644 doc/alpm-hooks.5.txt
 create mode 100644 lib/libalpm/hook.c
 create mode 100644 lib/libalpm/hook.h
 create mode 120000 lib/libalpm/ini.c
 create mode 120000 lib/libalpm/ini.h
 create mode 100644 test/pacman/tests/hook-abortonfail.py
 create mode 100644 test/pacman/tests/hook-exec-with-arguments.py
 create mode 100644 test/pacman/tests/hook-file-change-packages.py
 create mode 100644 test/pacman/tests/hook-file-remove-trigger-match.py
 create mode 100644 test/pacman/tests/hook-file-upgrade-nomatch.py
 create mode 100644 test/pacman/tests/hook-invalid-trigger.py
 create mode 100644 test/pacman/tests/hook-pkg-install-trigger-match.py
 create mode 100644 test/pacman/tests/hook-pkg-remove-trigger-match.py
 create mode 100644 test/pacman/tests/hook-pkg-upgrade-trigger-match.py
 create mode 100644 test/pacman/tests/hook-upgrade-trigger-no-match.py

-- 
2.6.1


More information about the pacman-dev mailing list