configure_alpm() in alpm-utils/src/conf.rs:45 configures hook directories with:
alpm.set_hookdirs(conf.hook_dir.iter())?;
set_hookdirs wraps alpm_option_set_hookdirs, which replaces the entire hookdir list. alpm_initialize adds SYSHOOKDIR (/usr/share/libalpm/hooks/) to the list by default, but this call overwrites it with only the directories from pacman-conf output (typically just /etc/pacman.d/hooks/).
so any consumer using alpm_with_conf or configure_alpm to set up a handle will not find system hooks, and post-transaction hooks do not run.
pacman itself calls alpm_option_add_hookdir for each configured directory rather than alpm_option_set_hookdirs, which preserves the system directory that alpm_initialize already added.
is the current behavior intentional, or would it make sense to align with pacman and iterate with add_hookdir instead?
configure_alpm()inalpm-utils/src/conf.rs:45configures hook directories with:set_hookdirswrapsalpm_option_set_hookdirs, which replaces the entire hookdir list.alpm_initializeaddsSYSHOOKDIR(/usr/share/libalpm/hooks/) to the list by default, but this call overwrites it with only the directories frompacman-confoutput (typically just/etc/pacman.d/hooks/).so any consumer using
alpm_with_conforconfigure_alpmto set up a handle will not find system hooks, and post-transaction hooks do not run.pacman itself calls
alpm_option_add_hookdirfor each configured directory rather thanalpm_option_set_hookdirs, which preserves the system directory thatalpm_initializealready added.is the current behavior intentional, or would it make sense to align with pacman and iterate with
add_hookdirinstead?