summaryrefslogtreecommitdiff
path: root/dependencies/analyses/dependency-tree.sh
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-07-08 15:28:39 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-07-16 14:16:16 +0200
commit849e2f3d4e1975bf02cfc7d2b32534294780a53b (patch)
tree3159237b1bb0e18a801f4d4eb54f824f599f7afa /dependencies/analyses/dependency-tree.sh
parentfb31cc95a596b9c7c09cbc712acd60027c32ddfa (diff)
downloadpodman-849e2f3d4e1975bf02cfc7d2b32534294780a53b.tar.gz
podman-849e2f3d4e1975bf02cfc7d2b32534294780a53b.tar.bz2
podman-849e2f3d4e1975bf02cfc7d2b32534294780a53b.zip
analyses: add dependency-tree.sh
Add a new analysis script to print the dependency tree. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'dependencies/analyses/dependency-tree.sh')
-rwxr-xr-xdependencies/analyses/dependency-tree.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/dependencies/analyses/dependency-tree.sh b/dependencies/analyses/dependency-tree.sh
new file mode 100755
index 000000000..3c9dccc51
--- /dev/null
+++ b/dependencies/analyses/dependency-tree.sh
@@ -0,0 +1,13 @@
+#!/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"