[pacman-dev] [PATCH] Fix using run_pacman to invoke -Qi with sudo

Allan McRae allan at archlinux.org
Wed May 16 04:41:52 UTC 2018


On 16/05/18 01:46, Dave Reisner wrote:
> On Tue, May 15, 2018 at 11:13:09AM -0400, Eli Schwartz wrote:
>> In commit 5698d7b66daa2a0bc99cab7a989cef1c806c3bf6 a new non-root use of
>> pacman was added -- previously we used -T or -Qq, and run_pacman did not
>> know how to special-case -Qi to skip being prepended with sudo.
> 
> Can we just be explicit about when we do and don't need elevated
> privileges rather than trying to guess? Surely the caller knows the
> requirements a priori.

Are you thinking two functions? One for root, one not?   Or a helper
function as_root() that does the su/sudo part?  Or a function parameter
for root usage?

Either way, I think the current patch is fine for 5.1.  Bigger change
can happen later.

A


More information about the pacman-dev mailing list