aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorkitsunyan2018-04-09 21:28:32 +0000
committerkitsunyan2018-04-09 21:28:32 +0000
commit8e43dfdecb444579e19e2dff5c070614687f426d (patch)
tree3c40e1937a891a749ed4c5a5ecdaaf2ea49f54e2 /src/feature
parent03c0242805a02dc90f3ab92f1aba2ba2f68200b5 (diff)
Replace more variables on privileges drop
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/syncinstall.nim26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim
index 41b54cd..04e9c0d 100644
--- a/src/feature/syncinstall.nim
+++ b/src/feature/syncinstall.nim
@@ -252,12 +252,12 @@ proc editLoop(config: Config, base: string, repoPath: string, gitPath: Option[st
('a', tr"abort operation"))
editFileLoop(file)
elif res == 'y':
- let visualEnv = getenv("VISUAL")
- let editorEnv = getenv("EDITOR")
- let editor = if visualEnv != nil and visualEnv.len > 0:
- $visualEnv
- elif editorEnv != nil and editorEnv.len > 0:
- $editorEnv
+ let visualEnv = getEnv("VISUAL")
+ let editorEnv = getEnv("EDITOR")
+ let editor = if visualEnv.len > 0:
+ visualEnv
+ elif editorEnv.len > 0:
+ editorEnv
else:
printColonUserInput(config.color, tr"Enter editor executable name" & ":",
noconfirm, "", "")
@@ -304,11 +304,11 @@ proc buildLoop(config: Config, pkgInfos: seq[PackageInfo], noconfirm: bool,
let gitPath = pkgInfos[0].gitPath
let buildPath = buildPath(repoPath, gitPath)
- let confFileEnv = getenv("MAKEPKG_CONF")
- let confFile = if confFileEnv == nil or confFileEnv.len == 0:
+ let confFileEnv = getEnv("MAKEPKG_CONF")
+ let confFile = if confFileEnv.len == 0:
sysConfDir & "/makepkg.conf"
else:
- $confFileEnv
+ confFileEnv
let workConfFile = config.tmpRoot & "/makepkg.conf"
@@ -334,8 +334,8 @@ proc buildLoop(config: Config, pkgInfos: seq[PackageInfo], noconfirm: bool,
printError(config.color, tr"failed to copy config file '$#'" % [confFile])
(none(BuildResult), 1)
else:
- let envExt = getenv("PKGEXT")
- let confExt = if envExt == nil or envExt.len == 0:
+ let envExt = getEnv("PKGEXT")
+ let confExt = if envExt.len == 0:
forkWaitRedirect(() => (block:
dropPrivileges()
execResult(bashCmd, "-c",
@@ -343,11 +343,11 @@ proc buildLoop(config: Config, pkgInfos: seq[PackageInfo], noconfirm: bool,
"bash", workConfFile)))
.output.optFirst.get("")
else:
- $envExt
+ envExt
let buildCode = forkWait(proc: int =
if chdir(buildPath) == 0:
- discard unsetenv("MAKEPKG_CONF")
+ discard cunsetenv("MAKEPKG_CONF")
dropPrivileges()
if not noextract: