mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 06:00:45 -06:00
add debug back
This commit is contained in:
parent
abf883c176
commit
8f85abc1fc
1 changed files with 15 additions and 7 deletions
|
@ -147,8 +147,18 @@ proc findSystemPaths(drvs: Table[string, NixDerivation]): seq[string] =
|
||||||
|
|
||||||
assert len(hosts) == len(result)
|
assert len(hosts) == len(result)
|
||||||
|
|
||||||
|
|
||||||
|
proc filterSeq(
|
||||||
|
drvs: seq[string],
|
||||||
|
filter: proc(s: string): bool,
|
||||||
|
): tuple[yes: seq[string], no: seq[string]] =
|
||||||
|
for drv in drvs:
|
||||||
|
if filter(drv): result.yes.add drv
|
||||||
|
else: result.no.add drv
|
||||||
|
|
||||||
|
|
||||||
func isIgnored(drv: string): bool =
|
func isIgnored(drv: string): bool =
|
||||||
const ignoredPackages = (slurp "ignored.txt").splitLines()
|
const ignoredPackages = (slurp "ignored.txt").strip().splitLines()
|
||||||
let name = drv.split("-", 1)[1].replace(".drv","")
|
let name = drv.split("-", 1)[1].replace(".drv","")
|
||||||
result = name in ignoredPackages
|
result = name in ignoredPackages
|
||||||
if not result:
|
if not result:
|
||||||
|
@ -157,17 +167,15 @@ func isIgnored(drv: string): bool =
|
||||||
return true
|
return true
|
||||||
|
|
||||||
proc systemPathDrvsToBuild(): seq[string] =
|
proc systemPathDrvsToBuild(): seq[string] =
|
||||||
|
var inputDrvs, dropped: seq[string]
|
||||||
let toBuild = toBuildNixosConfiguration()
|
let toBuild = toBuildNixosConfiguration()
|
||||||
let drvs = evaluateDerivations(nixosConfigAttrs())
|
let drvs = evaluateDerivations(nixosConfigAttrs())
|
||||||
let systemPaths = findSystemPaths(drvs)
|
let systemPaths = findSystemPaths(drvs)
|
||||||
var inputDrvs: seq[string]
|
|
||||||
for p in systemPaths:
|
for p in systemPaths:
|
||||||
inputDrvs &= drvs[p].inputDrvs.keys().toSeq()
|
inputDrvs &= drvs[p].inputDrvs.keys().toSeq()
|
||||||
result = inputDrvs.filterIt(it in toBuild)
|
(result, _) = filterSeq(inputDrvs, (s) => s in toBuild)
|
||||||
let nToBuild = result.len
|
(dropped, result) = filterSeq(result, isIgnored)
|
||||||
result = result.filterIt(not it.isIgnored)
|
debug fmt"ignored {dropped.len} derivations"
|
||||||
let nIgnored = nToBuild - result.len
|
|
||||||
debug fmt"ignored {nIgnored} derivations"
|
|
||||||
result = result.mapIt(it & "^*")
|
result = result.mapIt(it & "^*")
|
||||||
|
|
||||||
func splitDrv(drv: string): tuple[name, hash:string] =
|
func splitDrv(drv: string): tuple[name, hash:string] =
|
||||||
|
|
Loading…
Reference in a new issue