Add docs for how to handle errors in check-deps script (#7243)

This commit is contained in:
Daniel Nelson
2020-03-27 15:39:32 -07:00
committed by GitHub
parent f3ee1d86df
commit 608e818645

View File

@@ -48,8 +48,19 @@ for dep in $(LC_ALL=C sort -u "${tmpdir}/golist"); do
dep="${dep%%/v[0-9]}"
dep="${dep%%/v[0-9][0-9]}"
echo "${dep}" >> "${tmpdir}/actual"
echo "${dep}" >> "${tmpdir}/HEAD"
done
grep '^-' docs/LICENSE_OF_DEPENDENCIES.md | grep -v github.com/DataDog/datadog-agent | cut -f 2 -d' ' > "${tmpdir}/expected"
diff -U0 "${tmpdir}/expected" "${tmpdir}/actual"
grep '^-' docs/LICENSE_OF_DEPENDENCIES.md | grep -v github.com/DataDog/datadog-agent | cut -f 2 -d' ' > "${tmpdir}/LICENSE_OF_DEPENDENCIES.md"
diff -U0 "${tmpdir}/LICENSE_OF_DEPENDENCIES.md" "${tmpdir}/HEAD" ||
cat - <<EOF
The docs/LICENSE_OF_DEPENDENCIES.md file does not contain the expected entries.
Lines prefixed with '+' should be added to LICENSE_OF_DEPENDENCIES.md and '-'
lines should be removed.
Include a link to the appropriate licenses for any additions.
EOF