aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss30
1 files changed, 19 insertions, 11 deletions
diff --git a/kiss b/kiss
index a3f7428..ca7e6c7 100755
--- a/kiss
+++ b/kiss
@@ -408,8 +408,7 @@ pkg_fixdeps() {
# Generate a list of all installed manifests.
pkg_name=$1
- set +f
- set -f -- "$sys_db/"*/manifest
+ set +f; set -f -- "$sys_db/"*/manifest
# Get a list of binaries and libraries, false files
# will be found, however it's faster to get 'ldd' to check
@@ -424,22 +423,31 @@ pkg_fixdeps() {
# Skip lines containing 'ldd'.
[ "${dep##*ldd*}" ] || continue
- # Extract the file path from 'ldd' output.
+ # Extract the file path from 'ldd' output, and
+ # canonicalize the path.
dep=${dep#* => }
dep=${dep% *}
+ dep=$(readlink -f "$dep")
# Figure out which package owns the file.
- dep=$("$grep" -lFx "${dep##$KISS_ROOT}" "$@")
+ own=$("$grep" -lFx "${dep##$KISS_ROOT}" "$@")
+
+ # If the package wasn't found, retry by removing
+ # the '/usr' prefix.
+ if [ -z "$own" ] && [ -z "${dep%%/usr*}" ]; then
+ dep=${dep#/usr}
+ own=$("$grep" -lFx "${dep##$KISS_ROOT}" "$@")
+ fi
# Extract package name from 'grep' match.
- dep=${dep%/*}
- dep=${dep##*/}
+ own=${own%/*}
+ own=${own##*/}
- case $dep in
- # Skip listing these packages as dependencies.
- musl|gcc|${PWD##*/}|"") ;;
- *) printf '%s\n' "$dep" ;;
- esac
+ case $own in musl|gcc|"$pkg_name"|"") continue ; esac
+ printf 'Found %s (%s) in (%s)\n' "$own" "$dep" \
+ "${file##$pkg_dir/$pkg_name}" >/dev/tty
+
+ printf '%s\n' "$own"
done ||:
done >> depends