mirror of
https://github.com/logos-messaging/packages.git
synced 2026-01-02 14:13:05 +00:00
Package_scanner will now check for duplicate pkg names.
This commit is contained in:
parent
11fb1a8857
commit
eb5ca12960
@ -20,6 +20,8 @@ import httpclient
|
||||
import net
|
||||
import json
|
||||
import os
|
||||
import sets
|
||||
import strutils
|
||||
|
||||
const
|
||||
|
||||
@ -72,6 +74,8 @@ proc check(): int =
|
||||
let
|
||||
pkg_list = parseJson(readFile(getCurrentDir() / "packages.json"))
|
||||
|
||||
var names = initSet[string]()
|
||||
|
||||
for pdata in pkg_list:
|
||||
name = if pdata.hasKey("name"): pdata["name"].str else: nil
|
||||
|
||||
@ -111,6 +115,11 @@ proc check(): int =
|
||||
if not (pdata["license"].str in LICENSES):
|
||||
echo "W: ", name, " has an unexpected license: ", pdata["license"]
|
||||
|
||||
if name.normalize notin names:
|
||||
names.incl(name.normalize)
|
||||
else:
|
||||
echo("E: ", name, ": a package by that name already exists.")
|
||||
result.inc()
|
||||
|
||||
echo ""
|
||||
echo "Problematic packages count: ", result
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user