forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check license of dependencies file for changes (influxdata#7108)
- Loading branch information
1 parent
1eca315
commit 318a963
Showing
6 changed files
with
88 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/sh | ||
|
||
tmpdir="$(mktemp -d)" | ||
|
||
cleanup() { | ||
rm -rf "$tmpdir" | ||
} | ||
trap cleanup EXIT | ||
|
||
targets="$(go tool dist list)" | ||
|
||
for target in ${targets}; do | ||
# only check platforms we build for | ||
case "${target}" in | ||
linux/*) ;; | ||
windows/*) ;; | ||
freebsd/*) ;; | ||
darwin/*) ;; | ||
*) continue;; | ||
esac | ||
|
||
GOOS=${target%%/*} GOARCH=${target##*/} \ | ||
go list -deps -f '{{with .Module}}{{.Path}}{{end}}' ./cmd/telegraf/ >> "${tmpdir}/golist" | ||
done | ||
|
||
for dep in $(LC_ALL=C sort -u "${tmpdir}/golist"); do | ||
case "${dep}" in | ||
# ignore ourselves | ||
github.com/influxdata/telegraf) continue;; | ||
|
||
# dependency is replaced in go.mod | ||
github.com/satori/go.uuid) continue;; | ||
|
||
# go-autorest has a single license for all sub modules | ||
github.com/Azure/go-autorest/autorest) | ||
dep=github.com/Azure/go-autorest;; | ||
github.com/Azure/go-autorest/*) | ||
continue;; | ||
esac | ||
|
||
# Remove single and double digit version from path; these are generally not | ||
# actual parts of the path and instead indicate a branch or tag. | ||
# example: github.com/influxdata/go-syslog/v2 -> github.com/influxdata/go-syslog | ||
dep="${dep%%/v[0-9]}" | ||
dep="${dep%%/v[0-9][0-9]}" | ||
|
||
echo "${dep}" >> "${tmpdir}/actual" | ||
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" |