support comments in ignored.txt

This commit is contained in:
Daylin Morgan 2024-11-20 11:48:08 -06:00
parent 8606ed4523
commit 17569b7509
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 7 additions and 1 deletions

View file

@ -24,5 +24,7 @@ comma-with-db
nix-index-with-db
python
net.conf
# unclear why these needed to be added
llm
rofi
atticd-atticadm

View file

@ -170,9 +170,13 @@ proc filterSeq(
if filter(drv): result.yes.add drv
else: result.no.add drv
func getIgnoredPackages(): seq[string] =
for l in slurp("ignored.txt").strip().splitLines():
if not l.startsWith("#"):
result.add l
func isIgnored(drv: string): bool =
const ignoredPackages = (slurp "ignored.txt").strip().splitLines()
const ignoredPackages = getIgnoredPackages()
let name = drv.split("-", 1)[1].replace(".drv","")
result = name in ignoredPackages
if not result: