diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-16 15:52:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-16 15:52:50 +0200 |
commit | 7e4db4452fdece411e0ee8c7c8805c0c636f49ea (patch) | |
tree | 4eeb1e0b2c187645cb66733cc0445a085d9472e7 /dependencies/analyses/dependency-tree.sh | |
parent | d2291ecdd514befd18a8b57ff2c7a8ef0cf04ba8 (diff) | |
parent | 294ddc472047f5a13bcf1d9b41407e18b1fad984 (diff) | |
download | podman-7e4db4452fdece411e0ee8c7c8805c0c636f49ea.tar.gz podman-7e4db4452fdece411e0ee8c7c8805c0c636f49ea.tar.bz2 podman-7e4db4452fdece411e0ee8c7c8805c0c636f49ea.zip |
Merge pull request #3513 from vrothberg/analyses
Binary bloat analyses
Diffstat (limited to 'dependencies/analyses/dependency-tree.sh')
-rwxr-xr-x | dependencies/analyses/dependency-tree.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dependencies/analyses/dependency-tree.sh b/dependencies/analyses/dependency-tree.sh new file mode 100755 index 000000000..84085a50d --- /dev/null +++ b/dependencies/analyses/dependency-tree.sh @@ -0,0 +1,17 @@ +#!/usr/bin/bash + +if test "$#" -ne 1; then + echo "invalid arguments: usage: $0 path to package" + exit 1 +fi + +go list $1/... \ + | xargs -d '\n' go list -f '{{ .ImportPath }}: {{ join .Imports ", " }}' \ + | awk '{ printf "%s\n\n", $0 }' \ + > direct-tree.tmp.$$ && mv -f direct-tree.tmp.$$ direct-tree.txt + + +go list $1/... \ + | xargs -d '\n' go list -f '{{ .ImportPath }}: {{ join .Deps ", " }}' \ + | awk '{ printf "%s\n\n", $0 }' \ + > transitive-tree.tmp.$$ && mv -f transitive-tree.tmp.$$ transitive-tree.txt |