Skip to content

Add Gentoo improver and fix importer to handle revision operators#2199

Open
malladinagarjuna2 wants to merge 1 commit intoaboutcode-org:mainfrom
malladinagarjuna2:improver
Open

Add Gentoo improver and fix importer to handle revision operators#2199
malladinagarjuna2 wants to merge 1 commit intoaboutcode-org:mainfrom
malladinagarjuna2:improver

Conversation

@malladinagarjuna2
Copy link

fixes #2180

Introduced Gentoo Improver to resolve Gentoo advisory version ranges against package versions fetched from the packages.gentoo.org API. This converts abstract ranges (e.g., <1.9.7) into concrete affected and fixed version mappings.

Fix the Gentoo importer to properly handle revision operators (rge, rgt, rle) by mapping them to their correct comparators (>=, >, <=) using a RANGE_TO_COMPARATOR mapping. Replace the previous heuristic ("e" in range) with explicit operator handling.

used these papers for reference as mentioned by @keshav-space
https://projects.gentoo.org/pms/8/pms.html#x1-250003.2

https://projects.gentoo.org/pms/8/pms.html#x1-260003.3

ways to test it

python -m pytest -vvs vulnerabilities/tests/test_gentoo.py
python -m pytest -vvs vulnerabilities/tests/test_gentoo_improver.py

Both importer and improver tests pass.

@malladinagarjuna2
Copy link
Author

@ziadhany kindly review this pr

Signed-off-by: Malladi Nagarjuna <zombmalladinags69@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create gentoo imporver to handel revisione versions correctly

1 participant