1 #include <tools/ccanlint/ccanlint.h>
2 #include <ccan/foreach/foreach.h>
12 #include <ccan/talloc/talloc.h>
13 #include <ccan/str/str.h>
14 #include <ccan/str_talloc/str_talloc.h>
16 static void check_license_depends_compat(struct manifest *m,
17 unsigned int *timeleft,
24 /* If our license is unknown, we can't know the answer. */
25 if (m->license == LICENSE_UNKNOWN) {
26 score->score = score->total = 0;
30 list_for_each(&m->deps, i, list) {
31 struct doc_section *d = find_license_tag(i);
32 i->license = which_license(d);
34 if (i->license != LICENSE_UNKNOWN
35 && !license_compatible[m->license][i->license]) {
36 score_file_error(score, i->info_file, 0,
37 "Dependency ccan/%s has"
38 " incompatible license '%s'",
40 licenses[i->license].name);
46 score->score = score->total;
49 struct ccanlint license_depends_compat = {
50 .key = "license_depends_compat",
51 .name = "CCAN dependencies don't contain incompatible licenses",
52 .check = check_license_depends_compat,
53 .needs = "license_exists depends_exist"
55 REGISTER_TEST(license_depends_compat);