Mk/Uses/cargo.mk: cargo-crates to flag unknown git hosts

To avoid some head scratching print a warning instead of being
silent when encountering unhandled git hosts.
This commit is contained in:
Tobias Kortkamp
2019-08-07 10:37:10 +00:00
parent 20eee12e65
commit ee15f75b1e

View File

@@ -72,7 +72,9 @@ function split_url(s) {
tag = url["fragment"]
}
added = 0
if (url["host"] == "github.com") {
added = 1
gh_tuple[gh_tuple_len++] = sprintf(\
"%s:%s:%s:%s", account, project, tag, package_name)
} else {
@@ -88,9 +90,14 @@ function split_url(s) {
gl_tuple[gl_tuple_len++] = sprintf(\
"%s:%s:%s:%s:%s", site, account, project, tag, package_name)
}
added = 1
break
}
}
if (!added) {
printf "Warning: Ignoring git source on line %d: %s\n", NR, $3 > "/dev/stderr"
}
}
function print_array(start, arr, arrlen) {