commit:     1a54ac9c95fd230234f4c680ceda79a3de668b7f
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Mon Dec 25 21:45:08 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 26 17:43:58 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=1a54ac9c

atom: limit the start of a slot to left of use components.

It's a minor redundant protection + optimization, but
it's worth ensuring the only spot considered for a slot prefix
is left of any use restrictions.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcore/ebuild/atom.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pkgcore/ebuild/atom.py b/src/pkgcore/ebuild/atom.py
index f8725f607..0dc046fa4 100644
--- a/src/pkgcore/ebuild/atom.py
+++ b/src/pkgcore/ebuild/atom.py
@@ -99,7 +99,8 @@ class atom(boolean.AndRestriction, 
metaclass=klass.generic_equality):
         orig_atom = atom
         override_kls = False
         use_start = atom.find("[")
-        slot_start = atom.find(":")
+        # ensure slot or repo anchoring is left of use flags.
+        slot_start = atom.find(":", 0, use_start)
         eapi_obj = eapi_mod.get_eapi(
             eapi if eapi != "-1" else eapi_mod.LATEST_PMS_EAPI_VER
         )

Reply via email to