summaryrefslogtreecommitdiff
path: root/src/query.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-06-01 23:07:26 +0100
committerdavidovski <david@davidovski.xyz>2022-06-01 23:07:26 +0100
commit155aaf8e0e5db4fbf97a7428f74108e7e5c50426 (patch)
treeb3376a8c138d69c426300f5a9e11ccb590b24f63 /src/query.sh
parent449b7102812ff6845ea852017466b83d693a86cd (diff)
made file command work for /usr/ symlinks
Diffstat (limited to 'src/query.sh')
-rw-r--r--src/query.sh5
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