winpax / sfsu

(WIP) A modern, and very very fast, implementation of Scoop
Apache License 2.0
140 stars 7 forks source link

SEARCH: Unrelated packages appearing in binary/both search modes #468

Closed arnabadas closed 10 months ago

arnabadas commented 10 months ago

Describe the bug

Irrelevant search results showing up

Steps to To Reproduce

  1. Run sfsu search -m binary sed or sfsu search -m both sed

Expected behavior

Only relevant search results should have showed up scoop search sed produces this result:

Results from local buckets...

Name                Version         Source   Binaries
----                -------         ------   --------
msedgeredirect      0.7.5.0         extras
openclosedriveeject 3.21            extras
polsedit            1.0.0.5         extras
todolist            8.2.2           extras   TDLTransEdit.exe
bazel-buildtools    6.4.0           main     unused_deps.exe
busybox             5236-g7dff7f376 main     sed
djvulibre           3.5.28-4.12     main     djvused.exe
edgedriver          120.0.2210.77   main     msedgedriver.exe
gow                 0.8.0           main     sed.exe
pdf2djvu            0.9.19          main     djvused.exe
sed                 4.9             main
unxutils            2007.03.01      main     sed.exe
edgedriver-canary   122.0.2283.0    versions msedgedriver.exe
edgedriver-dev      121.0.2277.4    versions msedgedriver.exe

Full Output

Both the commands produce the same output output.txt

Version

1.6.3

Additional context

NA

jewlexx commented 10 months ago

sfsu uses regex internally to match strings, allowing it to match within larger strings.

In every single output the string 'sed' appears in either the package name or the binary name.

However, for sfsu v2, I plan to switch to glob, which will be more intuitive for cli users, and will likely get rid of this behaviour.

arnabadas commented 10 months ago

It is understandable that you are planning to switch to glob and you may not fix it as of now. But it needs to be acknowledged that currently the issue exists.

Kindly check the attached output.txt file in my original post. There are lots of packages without the word sed in package name or binary name. Just check the manifest of the first package: 010editor.json. There is no mention of the word sed anywhere.

jewlexx commented 10 months ago

This might be a different issue then, because it shouldn't be matching completely unrelated packages like that even using regex.

I'll have a look ASAP and see what's causing this.

jewlexx commented 10 months ago

This should be fixed after #473. Thanks for raising this issue.