aboutsummaryrefslogtreecommitdiff
path: root/src/pacman.nim
diff options
context:
space:
mode:
authorkitsunyan2018-04-08 20:54:18 +0000
committerkitsunyan2018-04-08 20:54:18 +0000
commit72b8161f2f37a0a6b091e300810a40e9a775c64b (patch)
tree2c127c810f6574da500dc3400b4a46f377640c26 /src/pacman.nim
parent52ab10b957d557f269363d5441a6fa34a2542b21 (diff)
Allow running via sudo
Diffstat (limited to 'src/pacman.nim')
-rw-r--r--src/pacman.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pacman.nim b/src/pacman.nim
index 5315df1..ecec5dc 100644
--- a/src/pacman.nim
+++ b/src/pacman.nim
@@ -352,7 +352,10 @@ proc obtainPacmanConfig*(args: seq[Argument]): PacmanConfig =
let ignorePkgs = getAll((none(string), "ignore")).toSet
let ignoreGroups = getAll((none(string), "ignoregroups")).toSet
- let hasKeyserver = runProgram(gpgConfCmd, "--list-options", "gpg")
+ let hasKeyserver = forkWaitRedirect(() => (block:
+ dropPrivileges()
+ execResult(gpgConfCmd, "--list-options", "gpg")))
+ .output
.filter(s => s.len > 10 and s[0 .. 9] == "keyserver:" and not (s[^2] == ':'))
.len > 0