Repository navigation
Conversation
Adnan9-63
force-pushed
the
fix/gentoo-slots-and-wildcards
branch
from
November 7, 2026 18:18
34c0cdf to
505ebbd
Compare
Adds support for parsing and validating Gentoo ebuild versions with package slots (e.g., 3.24.48:3, 6.9.3:6, 2.4.52:0/2.4) and wildcard suffixes (e.g., 1.3*, 7.3*). Extracts package slot qualifiers and wildcard markers while preserving standard PMS (Package Manager Specification Section 3.3) vercmp ordering. Also exposes .slot and .is_wildcard properties on GentooVersion, and implements component-prefix wildcard matching per PMS Section 8.2. Closes aboutcode-org#182 Assisted-by: Antigravity Signed-off-by: Adnan9-63 <muhammad1414114@gmail.com>
Adnan9-63
force-pushed
the
fix/gentoo-slots-and-wildcards
branch
from
November 12, 2026 08:57
505ebbd to
77a7cda
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What this PR does / why we need it:
Adds support for Gentoo ebuild versions containing package slot syntax (:3, :6, :0/2.4, :3=) and wildcard suffixes (1.3*, 7.3*, 7.4*).
Previously, versions such as 1.3* and 3.24.48:3 raised an InvalidVersion exception in downstream tools (such as VulnerableCode's GentooImporter when parsing GLSA advisories):
InvalidVersion constraints version: 1.3* error:'1.3*' is not a valid <class 'univers.versions.GentooVersion'>Changes:
src/univers/gentoo.py):parse_parts()helper to extract package slot qualifiers and wildcard suffixes.parse_version_and_revision()to strip slot and wildcard tokens so Portage PMS Section 3.3vercmpevaluates without crashes.is_valid()to accept valid slotted and wildcard ebuild versions while rejecting invalid tokens (*,1.3**,:3,3.24.48:invalid!slot).GentooVersion(src/univers/versions.py):.slotproperty returning the slot string (orNone)..is_wildcardboolean property indicating if the version contains a trailing wildcard.(Note: Kept comparison operators strictly focused on
</>/==to avoid overlap with open PR Implement __le__ and __ge__ for GentooVersion #211).tests/test_gentoo.py):1.3*,3.24.48:3,6.9.3:6,7.3*,7.4*).VersionConstraintandEbuildVersionRange(vers:ebuild/1.3*|>3.24.47:3).Fixes #182
Checklist:
pytest tests/test_gentoo.py tests/test_gentoo_pkgcore.py)black -l 100git commit -s)