From 4526e5a3f28f862dec23d2932b443bc9b530f321 Mon Sep 17 00:00:00 2001 From: davidovski Date: Thu, 2 Jun 2022 13:19:26 +0100 Subject: fixed issues with not finding libraries --- src/query.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/query.sh b/src/query.sh index 5082ed2..f9f2bcb 100644 --- a/src/query.sh +++ b/src/query.sh @@ -34,12 +34,15 @@ files () { file_info () { for file in $@; do - [ ! -f ${SYSROOT}$file ] && file=$(realpath $file) + [ ! -f ${SYSROOT}$file ] && file=$(realpath $file 2>/dev/null) for pkg in $(installed); do for list in ${INSTALLED_DIR}/$pkg/files; do - [ -f $list ] && grep -q ${file}$ $list && { - ${QUIET} && echo $pkg || printf "${LIGHT_BLUE}%s${BLUE} belongs to ${LIGHT_BLUE}%s${RESET}\n" $file $pkg - } + [ -f $list ] && { + + grep -q "^/usr${file}$" $list || grep -q "^${file}$" $list && { + ${QUIET} && echo $pkg || printf "${LIGHT_BLUE}%s${BLUE} belongs to ${LIGHT_BLUE}%s${RESET}\n" $file $pkg + } + } done done done -- cgit v1.2.1