Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705034 - packages.gentoo.org: incorrect package matching for USE flags with hyphens
Summary: packages.gentoo.org: incorrect package matching for USE flags with hyphens
Status: RESOLVED FIXED
Alias: None
Product: Websites
Classification: Unclassified
Component: Packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Packages Website
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-09 15:03 UTC by Thomas Kemmer
Modified: 2020-09-09 14:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kemmer 2020-01-09 15:03:57 UTC
For (hyphenated) multi-word USE flags, p.g.o considers each package a match that has a USE flag matching _any_ word of the query flag. For example, consider searching for all packages providing the "gmxapi-legacy" flag via:

https://packages.gentoo.org/useflags/gmxapi-legacy

This USE flags appears exclusively in sci-chemistry/gromacs but matches all of the following packages on p.g.o:

Packages describing “gmxapi-legacy” as local USE flag
- dev-db/mysql-connector-c++[legacy]
- dev-games/ogre[legacy-animations]
- dev-haskell/haskeline[legacy-encoding]
- dev-util/android-ndk[legacy-toolchains]
- dev-vcs/fossil[legacy-mv-rm]
- kde-plasma/plasma-meta[legacy-systray]
- sci-chemistry/gromacs[gmxapi-legacy]
- sci-libs/cgnslib[legacy]

Since the matched USE flags are not actually listed on the page, one would have to assume that all these packages provide the "gmxapi-legacy" flag, with the corresponding descriptions incorrectly listed as "gmxapi-legacy flag description". Similarly, searching for "legacy-systray" results again in the same list plus all packages providing a "systray" USE flag (e.g., Spotify).

This is not about finding similar (per-token) matches for a given USE flag but rather about explicitly listing the complete USE flag as local to the inexactly matched packages (including the flag descriptions). 

This happens on both p.g.o and ptest.g.o.

Reproducible: Always
Comment 1 Max Magorsch (RETIRED) Gentoo Infrastructure gentoo-dev 2020-01-10 00:40:34 UTC
Technically, this is related to the elasticsearch mapping. So far, the USE flag name has been mapped as 'text'. Accordingly it is analyzed by elasticsearch. That's why searching for gmxapi-legacy returns gmxapi-legacy, gmxapi, legacy and the like.

However, from a practical point of view, I think http://packages.gentoo.org/useflag/USEFLAG_NAME should just list packages with a exact match. That's why I have added a raw field to 'name' in: 
 - https://gitweb.gentoo.org/sites/packages.git/commit/?h=dev/main&id=2e41907448c53bcc13946c9498a419d50e1d3a2a
The raw field is mapped as keyword. This way, name and name.raw can be used side by side. Technically this is implemented using multi-fields. Furthermore name.raw is used for http://packages.gentoo.org/useflag/USEFLAG_NAME now, so that we just get exact matches.

A functionally like "please list all packages that include the USE flag gmxapi-legacy, gmxapi or legacy" should not be part of http://packages.gentoo.org/useflag/USEFLAG_NAME, I think. It might, however, be achieved using advanced search queries.

Does that sound like a way to go?
Comment 2 Thomas Kemmer 2020-01-13 08:57:36 UTC
Sounds good to me, thanks!
Comment 3 Max Magorsch (RETIRED) Gentoo Infrastructure gentoo-dev 2020-09-09 14:44:29 UTC
This should have been resolved since we rewrote the whole application in golang. Thus I am going to close this bug. 

However, please don't hesitate to let us know, if you still encounter any problems.