[pacman-dev] [PATCH] Make bash-completion optional

Eli Schwartz eschwartz at archlinux.org
Thu May 7 19:21:52 UTC 2020


On 5/7/20 2:45 PM, Wouter Wijsman wrote:
> The bash completion files were the only reason pacman was not able to
> build as a non-root user. This patch adds the option to not install
> these files. This was needed for my use case, hopefully upstream someone
> else has a use for it as well.

The problem should only happen during install, not during build. I
presume that it is trying to install to e.g.
/usr/share/bash-completion/completions/pacman and raising a PermissionError?

To find the correct install dir for the completions, it first tries to
look at pkg-config to see where pkg-config says they should be
installed. It then falls back on --datadir and installs to
${datadir}/bash-completion/completions/

If you have bash-completion installed and its pkg-config file points at
a root-owned location you'll need root to install pacman. If you don't
have bash-completion installed, then your custom prefix might not
actually be picked up by bash-completion.

I wonder what the right solution is here. In autotools land, ./configure
--help has this to say:

Some influential environment variables:
[...]
  bashcompdir value of completionsdir for bash-completion, overriding
              pkg-config


This is part of the builtin functionality of the pkg.m4 macros which
autotools is using. meson doesn't directly support anything like this.

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1601 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20200507/72512ab9/attachment.sig>


More information about the pacman-dev mailing list