aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorj-james2020-11-06 20:11:37 +0000
committerj-james2020-11-06 20:11:37 +0000
commit3eb14df9811583e4c4034f76604895cf79f311f1 (patch)
treed2dfc09d82bd5d9bdb2145a497c1db38ec9750e6 /src
parent7242638eb774b39b3c0fe0f4d2c24e9138edfd24 (diff)
Fix warnings introduced in Nim 1.4
Diffstat (limited to 'src')
-rw-r--r--src/common.nim12
-rw-r--r--src/config.nim4
-rw-r--r--src/feature/syncclean.nim2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/common.nim b/src/common.nim
index 3f9013c..618ea42 100644
--- a/src/common.nim
+++ b/src/common.nim
@@ -233,10 +233,10 @@ proc queryUnrequired*(handle: ptr AlpmHandle, withOptional: bool, withoutOptiona
installed.add(pkg.toPackageReference)
if pkg.reason == AlpmReason.explicit:
explicit &= $pkg.name
- dependsTable.add($pkg.name,
- depends.map(x => (x, false)) + optional.map(x => (x, true)))
+ dependsTable[$pkg.name] =
+ depends.map(x => (x, false)) + optional.map(x => (x, true))
if provides.len > 0:
- alternatives.add($pkg.name, provides)
+ alternatives[$pkg.name] = provides
(installed, explicit.toHashSet + assumeExplicit, dependsTable, alternatives)
@@ -484,7 +484,7 @@ proc cloneBareRepo(config: Config, bareKind: BareKind, bareName: string,
if forkWait(() => (block:
if not dropPrivileges or dropPrivileges():
- if existsDir(repoPath):
+ if dirExists(repoPath):
let branch = branchOption.get("master")
execResult(gitCmd, "-C", repoPath, "fetch", "-q", "--no-tags",
"origin", branch & ":" & branch)
@@ -665,7 +665,7 @@ proc cloneAurRepo*(config: Config, base: string, gitUrl: string,
if message.isSome:
(1, message)
- elif repoPath.existsDir():
+ elif repoPath.dirExists():
(0, none(string))
else:
let fullName = bareFullName(BareKind.pkg, base)
@@ -674,7 +674,7 @@ proc cloneAurRepo*(config: Config, base: string, gitUrl: string,
let cloneBareCode = forkWait(() => (block:
if not dropPrivileges or dropPrivileges():
- if existsDir(bareRepoPath):
+ if dirExists(bareRepoPath):
execResult(gitCmd, "-C", bareRepoPath, "fetch", "-q", "--no-tags",
"origin", "master:master")
else:
diff --git a/src/config.nim b/src/config.nim
index e8be1fc..e54b7b9 100644
--- a/src/config.nim
+++ b/src/config.nim
@@ -81,9 +81,9 @@ proc readConfigFile*(configFile: string):
table[currentCategory] = category
elif currentCategory.len > 0:
if line.match(re"(\w+)\ *=\ *(.*)", matches):
- category[].add(matches[0], matches[1])
+ category[matches[0]] = matches[1]
else:
- category[].add(line, "")
+ category[line] = ""
false
except EOFError:
diff --git a/src/feature/syncclean.nim b/src/feature/syncclean.nim
index 6b1f853..ad0c255 100644
--- a/src/feature/syncclean.nim
+++ b/src/feature/syncclean.nim
@@ -31,7 +31,7 @@ proc handleSyncClean*(args: seq[Argument], config: Config): int =
else:
echo(tr"removing all package repositories...")
- if existsDir(reposCacheDir):
+ if dirExists(reposCacheDir):
withAlpmConfig(config, false, handle, dbs, errors):
for e in errors: printError(config.color, e)