mirror of
https://github.com/pyenv/pyenv.git
synced 2026-09-10 07:36:16 -04:00
pyenv-binary-save: document parsed dependency formats
This commit is contained in:
parent
ff71464787
commit
7e8a1b740f
|
|
@ -115,8 +115,12 @@ system_deps() {
|
|||
otool -L "$f" 2>/dev/null | tail -n +2 | awk -v pfx="${prefix}/" \
|
||||
'$1 !~ /^@/ && substr($1, 1, length(pfx)) != pfx { print $1 }'
|
||||
else
|
||||
# GNU binutils 2.44 writes "(NEEDED) ... [name]"; FreeBSD 15.1 writes
|
||||
# "NEEDED ... [name]". readelf(1) documents -d, not its text format.
|
||||
needed="$(LC_ALL=C readelf -dW "$f" 2>/dev/null | awk \
|
||||
'$2 == "(NEEDED)" || $2 == "NEEDED" { sub(/^.*\[/, ""); sub(/\].*$/, ""); print }' | tr '\n' ' ')"
|
||||
# Linux and FreeBSD ldd write resolved libraries as
|
||||
# "name => /absolute/path (address)"; entries without "=>" are ignored.
|
||||
LC_ALL=C ldd "$f" 2>/dev/null | awk -v needed="$needed" -v pfx="${prefix}/" '
|
||||
BEGIN {
|
||||
split(needed, deps, " ")
|
||||
|
|
|
|||
Loading…
Reference in a new issue