mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 00:20: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 |
|
find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null |
|
||||||
|
|
||||||
while read -r file; do
|
while read -r file; do
|
||||||
|
ldd_buf=$(ldd -- "$file" 2>/dev/null) ||:
|
||||||
|
|
||||||
case $elf_cmd in
|
case $elf_cmd in
|
||||||
*readelf)
|
*readelf)
|
||||||
"$elf_cmd" -d "$file"
|
"$elf_cmd" -d "$file"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
ldd -- "$file"
|
printf '%s\n' "$ldd_buf"
|
||||||
;;
|
;;
|
||||||
esac 2>/dev/null |
|
esac 2>/dev/null |
|
||||||
|
|
||||||
@ -474,11 +476,15 @@ pkg_fix_deps() {
|
|||||||
case $line in
|
case $line in
|
||||||
*NEEDED*\[*\] | *'=>'*)
|
*NEEDED*\[*\] | *'=>'*)
|
||||||
# readelf: 0x0000 (NEEDED) Shared library: [libjson-c.so.5]
|
# 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 ...
|
# Resolve library path.
|
||||||
line=${line##*=> }
|
# ldd: libjson-c.so.5 => /lib/libjson-c.so.5 ...
|
||||||
|
case $elf_cmd in
|
||||||
|
*readelf) line=${ldd_buf#*" $line => "} ;;
|
||||||
|
*) line=${line##*=> } ;;
|
||||||
|
esac
|
||||||
line=${line%% *}
|
line=${line%% *}
|
||||||
|
|
||||||
# Skip files owned by libc and POSIX.
|
# Skip files owned by libc and POSIX.
|
||||||
|
Loading…
Reference in New Issue
Block a user