mirror of
https://github.com/containers/podman.git
synced 2025-05-17 06:59:07 +08:00
dependency/analyses: simplify scripts
Credits to bash wizard @edsantiago for the changes. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
11
dependencies/analyses/dependency-tree.sh
vendored
11
dependencies/analyses/dependency-tree.sh
vendored
@ -5,16 +5,13 @@ if test "$#" -ne 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DATA=$(go list $1/... \
|
||||
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
|
||||
|
||||
echo "$DATA" > direct-tree.txt
|
||||
|
||||
DATA=$(go list $1/... \
|
||||
go list $1/... \
|
||||
| xargs -d '\n' go list -f '{{ .ImportPath }}: {{ join .Deps ", " }}' \
|
||||
| awk '{ printf "%s\n\n", $0 }' \
|
||||
)
|
||||
|
||||
echo "$DATA" > transitive-tree.txt
|
||||
> transitive-tree.tmp.$$ && mv -f transitive-tree.tmp.$$ transitive-tree.txt
|
||||
|
10
dependencies/analyses/nm-symbols-analysis.sh
vendored
10
dependencies/analyses/nm-symbols-analysis.sh
vendored
@ -5,11 +5,5 @@ if test "$#" -ne 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DATA=$(go tool nm -size "$1" \
|
||||
| awk 'NF==4 {printf "%s\t%s\t%s\n", $2, $3, $4}' \
|
||||
| grep -v -P "\t_\t" \
|
||||
| grep -P "\tt\t" \
|
||||
| awk ' {printf "%s\t\t%s\n", $1, $3} ' \
|
||||
)
|
||||
|
||||
echo "$DATA"
|
||||
go tool nm -size "$1" \
|
||||
| awk 'NF==4 && $3=="t" {printf "%s\t\t%s\n", $2, $4}'
|
||||
|
Reference in New Issue
Block a user