Skip to content

bee-query: find now packages with special characters #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

david
Copy link

@david david commented Sep 21, 2021

at the moment installed on sigusr2 for testing

schrader@bacon:~/git_zeug/bee
[bee-query-with-special-character]$ sudo bee query /usr/include/gpgme++/
schrader@bacon:~/git_zeug/bee

schrader@sigusr2:~
$ sudo bee query /usr/include/gpgme++/
gpgme-1.16.0-0.x86_64

@@ -85,7 +85,7 @@ function get_pkgs() {

for pkg in $(bee-list --installed) ; do

if egrep -q "file=.*${f}" "${BEE_METADIR}/${pkg}/CONTENT" ; then
if grep -q "file=.*${f}" "${BEE_METADIR}/${pkg}/CONTENT" ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So up to know, extended regular regressions were supported, which would not work anymore. No idea, what behavior is desired, but it should be mentioned.

But now extended regular expressions didn't work anymore
@david david force-pushed the bee-query-with-special-character branch from 185ddab to 44ea064 Compare September 21, 2021 12:05
@donald
Copy link
Contributor

donald commented Nov 5, 2024

This patch no longer appiles. However, the current code might be worse:

    ${BEEFLOCK} --shared ${BEECACHE_INVENTORY} \
        ${BEE_LIBEXECDIR}/bee/beeindextr ${BEECACHE_INVENTORY} | \
        grep -- "$file_pattern" | \
        sort | \
        while read -r pkg mtime uid gid mode size md5 filename; do
            if [[ $filename =~ $file_pattern ]]; then
                if [ "$pkg" != "$last_pkg" ]; then
                    echo $pkg
                    last_pkg="$pkg"
                fi
                printf "    %s\n" "$filename"
            fi
        done

so the pattern is used twice. Once with grep, which means a (non-extended) regular expression and once with [[ =~ ]] which is an extended regular expression. So, strangely, now bee query /usr/include/gpgme++ works but bee query /usr/include/gpgme++/ doesn't.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants