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,
18 unsigned int *timeleft,
25 /* If our license is unknown, we can't know the answer. */
26 if (m->license == LICENSE_UNKNOWN) {
27 score->score = score->total = 0;
31 list_for_each(&m->deps, i, list) {
32 struct doc_section *d = find_license_tag(i);
33 i->license = which_license(d);
35 if (i->license != LICENSE_UNKNOWN
36 && !license_compatible[m->license][i->license]) {
37 score_file_error(score, i->info_file, 0,
38 "Dependency ccan/%s has"
39 " incompatible license '%s'",
41 licenses[i->license].name);
47 score->score = score->total;
50 struct ccanlint license_depends_compat = {
51 .key = "license_depends_compat",
52 .name = "CCAN dependencies don't contain incompatible licenses",
53 .check = check_license_depends_compat,
54 .needs = "license_exists depends_exist"
56 REGISTER_TEST(license_depends_compat);