[pacman-dev] [PATCH 2/2] pacman: don't run hooks when using --dbonly
Allan McRae
allan at archlinux.org
Sat Sep 4 10:46:33 UTC 2021
On 13/6/21 10:28 pm, morganamilo wrote:
> --dbonly is meant to only touch the database and not the actual system.
> However hooks still run which can leave files in place or run commands
> you may not want.
>
> The hooks being run also means `fakeroot pacman -S --dbpath test/ foo --dbonly`
> fails because alpm tries to chroot for hooks which requires real root.
> ---
> src/pacman/pacman.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
> index 7e810127..f94fd2ea 100644
> --- a/src/pacman/pacman.c
> +++ b/src/pacman/pacman.c
> @@ -633,6 +633,7 @@ static int parsearg_trans(int opt)
> case OP_DBONLY:
> config->flags |= ALPM_TRANS_FLAG_DBONLY;
> config->flags |= ALPM_TRANS_FLAG_NOSCRIPTLET;
> + config->flags |= ALPM_TRANS_FLAG_NOHOOKS;
> break;
> case OP_NOPROGRESSBAR:
> config->noprogressbar = 1;
>
OK
More information about the pacman-dev
mailing list