Skip to content

Commit

Permalink
kpkg: fix build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kreatoo committed Aug 7, 2023
1 parent 4b10d9e commit f2651bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kpkg/commands/buildcmd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ proc build*(no = false, yes = false, root = "/",
err("please enter a package name", false)

try:
deps = dephandler(packages, bdeps = true)&dephandler(packages)
deps = dephandler(packages, bdeps = true, isBuild = true)&dephandler(packages, isBuild = true)
except CatchableError:
raise

Expand Down
8 changes: 4 additions & 4 deletions kpkg/modules/dephandler.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ proc isIn(one: seq[string], two: seq[string]): bool =
return true
return false

proc dephandler*(pkgs: seq[string], ignoreDeps = @[" "], bdeps = false): seq[string] =
proc dephandler*(pkgs: seq[string], ignoreDeps = @[" "], bdeps = false, isBuild = false): seq[string] =
## takes in a seq of packages and returns what to install.
var deps: seq[string]
try:
Expand Down Expand Up @@ -39,14 +39,14 @@ proc dephandler*(pkgs: seq[string], ignoreDeps = @[" "], bdeps = false): seq[st

let deprf = parse_runfile(repo&"/"&dep)

if not isEmptyOrWhitespace(deprf.bdeps.join()):
deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = true))
if not isEmptyOrWhitespace(deprf.bdeps.join()) and isBuild:
deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = true, isBuild = true))

if dep in pkgs or dep in deps or isIn(deps, ignoreDeps) or
dep in ignoreDeps:
continue

deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = false))
deps.add(dephandler(@[dep], deps&ignoreDeps, bdeps = false, isBuild = isBuild))

deps.add(dep)

Expand Down

0 comments on commit f2651bd

Please sign in to comment.