Skip to content

Commit c95ec77

Browse files
tsteenbefviernau
authored andcommitted
ort-analyzer: Support using a package curation directory
ORT users can correct invalid or missing package metadata and set the concluded license for packages using a curations. By default ORT will use a curations.yml file however it also supports using a directory with multiple curation files is supported, see [1]. As ort-config [2] uses a curations directory and as it used as a fallback in ORT for GitLab we need to support both ways of specifying curations. [1]: https://github.com/oss-review-toolkit/ort/blob/main/docs/config-file-curations-yml.md [2]: https://github.com/oss-review-toolkit/ort-config Signed-off-by: Thomas Steenbergen <[email protected]>
1 parent 9142b43 commit c95ec77

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ ort-scan:
132132
ORT_CONFIG_DIR: "ort-configuration"
133133
ORT_CONFIG_COPYRIGHT_GARBAGE_FILE: "${ORT_CONFIG_DIR}/copyright-garbage.yml"
134134
ORT_CONFIG_CURATIONS_FILE: "${ORT_CONFIG_DIR}/curations.yml"
135+
ORT_CONFIG_CURATIONS_DIR: "${ORT_CONFIG_DIR}/curations"
135136
ORT_CONFIG_CUSTOM_LICENSE_TEXTS_DIR: "${ORT_CONFIG_DIR}/custom-license-ids"
136137
ORT_CONFIG_LICENSE_CONFIGURATION_FILE: "${ORT_CONFIG_DIR}/license-classifications.yml"
137138
ORT_CONFIG_RESOLUTIONS_FILE: "${ORT_CONFIG_DIR}/resolutions.yml"

scripts/ort-analyzer.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ if [ "$VCS_TYPE" = "git" ]; then
2020
popd
2121
fi
2222

23-
ORT_ANALYZER_OPTIONS="--package-curations-file $ORT_CONFIG_CURATIONS_FILE"
23+
if [[ -d "$ORT_CONFIG_CURATIONS_DIR" ]]; then
24+
ORT_ANALYZER_OPTIONS="--package-curations-dir $ORT_CONFIG_CURATIONS_DIR"
25+
elif [[ -f "$ORT_CONFIG_CURATIONS_FILE" ]]; then
26+
ORT_ANALYZER_OPTIONS="--package-curations-file $ORT_CONFIG_CURATIONS_FILE"
27+
else
28+
ORT_ANALYZER_OPTIONS=""
29+
fi
2430

2531
if [[ -n "$ORT_CONFIG_FILE" ]]; then
2632
ORT_ANALYZER_OPTIONS="$ORT_ANALYZER_OPTIONS --repository-configuration-file $CI_PROJECT_DIR/$ORT_CONFIG_FILE";

0 commit comments

Comments
 (0)