Files
podman/dependencies/analyses/dependency-tree.sh
Valentin Rothberg 25d63f009d dependency-tree analysis: direct and transitive
Change the script to generate two files.  One including direct
dependencies, the other including direct and transitive dependencies.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-07-16 14:16:16 +02:00

21 lines
449 B
Bash
Executable File

#!/usr/bin/bash
if test "$#" -ne 1; then
echo "invalid arguments: usage: $0 path to package"
exit 1
fi
DATA=$(go list $1/... \
| xargs -d '\n' go list -f '{{ .ImportPath }}: {{ join .Imports ", " }}' \
| awk '{ printf "%s\n\n", $0 }' \
)
echo "$DATA" > direct-tree.txt
DATA=$(go list $1/... \
| xargs -d '\n' go list -f '{{ .ImportPath }}: {{ join .Deps ", " }}' \
| awk '{ printf "%s\n\n", $0 }' \
)
echo "$DATA" > transitive-tree.txt