diff options
author | davidovski <david@davidovski.xyz> | 2022-06-01 23:07:26 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-06-01 23:07:26 +0100 |
commit | 155aaf8e0e5db4fbf97a7428f74108e7e5c50426 (patch) | |
tree | b3376a8c138d69c426300f5a9e11ccb590b24f63 | |
parent | 449b7102812ff6845ea852017466b83d693a86cd (diff) |
made file command work for /usr/ symlinks
-rw-r--r-- | src/query.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/query.sh b/src/query.sh index 17f0c57..5082ed2 100644 --- a/src/query.sh +++ b/src/query.sh @@ -37,8 +37,9 @@ file_info () { [ ! -f ${SYSROOT}$file ] && file=$(realpath $file) for pkg in $(installed); do for list in ${INSTALLED_DIR}/$pkg/files; do - grep -q ^${file}$ $list && - printf "${LIGHT_BLUE}%s${BLUE} belongs to ${LIGHT_BLUE}%s${RESET}\n" $file $pkg + [ -f $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 |