diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/query.sh | 11 |
1 files 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 |