Compare commits

..

1 commit

Author SHA1 Message Date
Joey
afa8c1b105
Update packages.json for nim-libnx 2018-06-20 07:39:10 +09:00
5 changed files with 373 additions and 9808 deletions

1
.gitattributes vendored
View file

@ -1 +0,0 @@
/packages.json merge=union

View file

@ -4,20 +4,18 @@ dist: trusty
language: c
cache:
directories:
- "$HOME/.choosenim"
install:
- export CHOOSENIM_CHOOSE_VERSION="0.18.0"
- |
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
sh init.sh -y
- export PATH=$HOME/.nimble/bin:$PATH
wget http://nim-lang.org/download/nim-0.13.0.tar.xz
tar xf nim-0.13.0.tar.xz
cd nim-0.13.0
sh build.sh
cd ..
before_script:
- set -e
- set -x
- export PATH=`pwd`/nim-0.13.0/bin:$PATH
script:
- nim c -d:ssl -r package_scanner.nim && node ./validate_json.js

View file

@ -4,7 +4,8 @@ This is a central listing of all packages for
[Nimble](https://github.com/nim-lang/nimble), a package manager for the
[Nim programming language](http://nim-lang.org).
An overview of all packages is available at https://nimble.directory.
An overview of all Nimble packages is available in the
[library documentation](https://nim-lang.org/docs/lib.html#nimble).
NOTE: The packages listed here are not peer-reviewed or otherwise screened. We try to keep the list up-to-date but we cannot guarantee quality or maturity of the packages.
@ -36,7 +37,6 @@ While we really appreciate your contribution, please follow the requirements: ot
* The package should build correctly with the latest Nim release
* The package should not contain files without a license or in breach of 3rd parties licensing
* Non-mature packages should be flagged as such, especially if they perform security-critical tasks (e.g. encryption)
* If a vulnerability is found, make a patch release against the latest stable release (or more) that fixes the issue without introducing any other change.
* Tiny libraries should be avoided where possible
* Avoid having many dependencies. Use "when defined(...)" to enable optional features.
* If abandoning a package, please tag it as "abandoned"
@ -44,7 +44,7 @@ While we really appreciate your contribution, please follow the requirements: ot
* Provide a contact email address.
* Optionally try to support older Nim releases (6 months to 1 year)
* Optionally GPG-sign your releases
* Optionally follow [SemVer 2](http://semver.org)
* Optionally follow [SemVer](http://semver.org)
Your packages may be removed if the url stops working. It goes without saying
that your pull request will not be accepted unless you fill out all of the

View file

@ -25,6 +25,7 @@ import sets
import strutils
const
LICENSES = @[
"Allegro 4 Giftware",
"Apache License 2.0",
@ -46,6 +47,7 @@ const
"ISC",
"Unlicense"
]
VCS_TYPES = @["git", "hg"]
proc canFetchNimbleRepository(name: string, urlJson: JsonNode): bool =
@ -61,8 +63,9 @@ proc canFetchNimbleRepository(name: string, urlJson: JsonNode): bool =
try:
discard getContent(url, timeout=10000)
except HttpRequestError, TimeoutError:
echo "W: ", name, ": unable to fetch repo ", url, " ",
echo "E: ", name, ": unable to fetch repository ", url, " ",
getCurrentExceptionMsg()
result = false
except AssertionError:
echo "W: ", name, ": httpclient failed ", url, " ",
getCurrentExceptionMsg()
@ -78,43 +81,57 @@ proc verifyAlias(pdata: JsonNode, result: var int) =
# TODO: Verify that 'alias' points to a known package.
proc check(): int =
var name: string
var
name: string
echo ""
let pkg_list = parseJson(readFile(getCurrentDir() / "packages.json"))
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: ""
name = if pdata.hasKey("name"): pdata["name"].str else: nil
if pdata.hasKey("alias"):
verifyAlias(pdata, result)
else:
if name == "":
if name.isNil:
echo "E: missing package name"
result.inc()
elif not pdata.hasKey("method"):
echo "E: ", name, " has no method"
result.inc()
elif not (pdata["method"].str in VCS_TYPES):
echo "E: ", name, " has an unknown method: ", pdata["method"].str
result.inc()
elif not pdata.hasKey("url"):
echo "E: ", name, " has no URL"
result.inc()
elif pdata.hasKey("web") and not canFetchNimbleRepository(name, pdata["web"]):
result.inc()
elif not pdata.hasKey("tags"):
echo "E: ", name, " has no tags"
result.inc()
elif not pdata.hasKey("description"):
echo "E: ", name, " has no description"
result.inc()
elif not pdata.hasKey("license"):
echo "E: ", name, " has no license"
result.inc()
elif pdata["url"].str.normalize.startsWith("git://github.com/"):
echo "E: ", name, " has an insecure git:// URL instead of https://"
result.inc()
else:
# Other warnings should go here
if not (pdata["license"].str in LICENSES):

File diff suppressed because it is too large Load diff