Skip to content

configure_alpm uses set_hookdirs which replaces system hookdir #65

Description

@pfeifferj

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions