| |
---|
| | foreach (n, i; package_indices) logDebug(" %s (%s%s): %s", n, i, n in maybe_optional_deps ? ", maybe optional" : ", required", all_configs[i]); |
---|
| | |
---|
| | auto config_indices = new size_t[all_configs.length]; |
---|
| | config_indices[] = 0; |
---|
| | |
---|
| | string last_error; |
---|
| | |
---|
| | visited = null; |
---|
| | sizediff_t validateConfigs(TreeNode parent, ref string error) |
---|
| | { |
---|
| |
---|
| | throw new Exception(format("Root package %s references unknown package %s", parent.pack, ch.pack)); |
---|
| | } |
---|
| | // choose another parent config to avoid the invalid child |
---|
| | if (parentidx > maxcpi) { |
---|
| | error = format("Package %s contains invalid dependency %s", parent.pack, ch.pack); |
---|
| | error = format("Package %s contains invalid dependency %s (no version candidates)", parent.pack, ch.pack); |
---|
| | logDiagnostic("%s (ci=%s)", error, parentidx); |
---|
| | maxcpi = parentidx; |
---|
| | } |
---|
| | } else { |
---|
| |
---|
| | // check if the current combination of configurations works out |
---|
| | visited = null; |
---|
| | string error; |
---|
| | auto conflict_index = validateConfigs(root, error); |
---|
| | if (first_error !is null) first_error = error; |
---|
| | if (first_error is null) first_error = error; |
---|
| | |
---|
| | // print out current iteration state |
---|
| | logDebug("Interation (ci=%s) %s", conflict_index, { |
---|
| | import std.array : join; |
---|
| |
---|
| | |