mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-24 16:10:05 -07:00
pkg_fix_deps: simplify path resolution
This commit is contained in:
parent
4de133f546
commit
a25725530a
16
kiss
16
kiss
@ -460,13 +460,15 @@ pkg_fix_deps() {
|
||||
find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null |
|
||||
|
||||
while read -r file; do
|
||||
ldd_buf=$(ldd -- "$file" 2>/dev/null) ||:
|
||||
|
||||
case $elf_cmd in
|
||||
*readelf)
|
||||
"$elf_cmd" -d "$file"
|
||||
;;
|
||||
|
||||
*)
|
||||
ldd -- "$file"
|
||||
printf '%s\n' "$ldd_buf"
|
||||
;;
|
||||
esac 2>/dev/null |
|
||||
|
||||
@ -474,11 +476,15 @@ pkg_fix_deps() {
|
||||
case $line in
|
||||
*NEEDED*\[*\] | *'=>'*)
|
||||
# readelf: 0x0000 (NEEDED) Shared library: [libjson-c.so.5]
|
||||
line=${line##*[}
|
||||
line=${line%%]*}
|
||||
line=${line##*\[}
|
||||
line=${line%%\]*}
|
||||
|
||||
# ldd: libjson-c.so.5 => /lib/libjson-c.so.5 ...
|
||||
line=${line##*=> }
|
||||
# Resolve library path.
|
||||
# ldd: libjson-c.so.5 => /lib/libjson-c.so.5 ...
|
||||
case $elf_cmd in
|
||||
*readelf) line=${ldd_buf#*" $line => "} ;;
|
||||
*) line=${line##*=> } ;;
|
||||
esac
|
||||
line=${line%% *}
|
||||
|
||||
# Skip files owned by libc and POSIX.
|
||||
|
Loading…
Reference in New Issue
Block a user