@@ -208,6 +208,11 @@ class ProfileError(results.ProfilesResult, results.LogError):
208208_make_defaults_assign_re = re .compile (r"^[a-zA-Z][a-zA-Z0-9_]*=(?P<value>.*)$" )
209209
210210
211+ def _incremental_values (value : str ) -> set [str ]:
212+ """Values named by an incremental variable, without negations or resets."""
213+ return {x .removeprefix ("-" ) for x in value .split () if x != "-*" }
214+
215+
211216# mapping of profile log levels to result classes
212217_logmap = (
213218 base .LogMap ("pkgcore.log.logger.warning" , ProfileWarning ),
@@ -405,11 +410,8 @@ def _make_defaults(self, filename: str, node: sources.ProfileNode, vals: dict[st
405410 if len (value ) < 2 or value [0 ] != '"' or value [- 1 ] != '"' :
406411 yield MakeDefaultsUnquoted (pjoin (node .name , filename ), lineno , line )
407412 if (
408- use_flags := {
409- use .removeprefix ("-" )
410- for use_group in ("USE" , "IUSE_IMPLICIT" )
411- for use in vals .get (use_group , "" ).split ()
412- }
413+ use_flags := _incremental_values (vals .get ("USE" , "" ))
414+ | _incremental_values (vals .get ("IUSE_IMPLICIT" , "" ))
413415 ) and (unknown := use_flags - self .available_iuse ):
414416 yield UnknownProfileUse (pjoin (node .name , filename ), unknown )
415417 implicit_use_expands = set (vals .get ("USE_EXPAND_IMPLICIT" , "" ).split ())
@@ -418,7 +420,7 @@ def _make_defaults(self, filename: str, node: sources.ProfileNode, vals: dict[st
418420 "USE_EXPAND_HIDDEN" ,
419421 "USE_EXPAND_UNPREFIXED" ,
420422 ):
421- values = { use . removeprefix ( "-" ) for use in vals .get (use_group , "" ). split ()}
423+ values = _incremental_values ( vals .get (use_group , "" ))
422424 if unknown := values - self .use_expand_groups .keys () - implicit_use_expands :
423425 yield UnknownProfileUseExpand (pjoin (node .name , filename ), use_group , unknown )
424426 for key , val in vals .items ():
@@ -432,7 +434,7 @@ def _make_defaults(self, filename: str, node: sources.ProfileNode, vals: dict[st
432434 else :
433435 yield UnknownProfileUseExpand (pjoin (node .name , filename ), key , [use_group ])
434436 for key in vals .keys () & self .use_expand_groups .keys ():
435- if unknown := set (vals . get ( key , "" ). split () ) - self .use_expand_groups [key ]:
437+ if unknown := _incremental_values (vals [ key ] ) - self .use_expand_groups [key ]:
436438 yield UnknownProfileUseExpandValue (pjoin (node .name , filename ), key , unknown )
437439 if missing_values := {
438440 use_group
0 commit comments