@@ -302,6 +302,33 @@ def desc(self):
302302 )
303303
304304
305+ class _ProfileEapiResult (results .ProfilesResult ):
306+ """Generic profile EAPI result."""
307+
308+ _type = None
309+
310+ def __init__ (self , profile , eapi ):
311+ super ().__init__ ()
312+ self .profile = profile
313+ self .eapi = str (eapi )
314+
315+ @property
316+ def desc (self ):
317+ return f"{ self .profile !r} profile is using { self ._type } EAPI { self .eapi } "
318+
319+
320+ class BannedProfileEapi (_ProfileEapiResult , results .Error ):
321+ """Profile has an EAPI that is banned in the repository."""
322+
323+ _type = 'banned'
324+
325+
326+ class DeprecatedProfileEapi (_ProfileEapiResult , results .Warning ):
327+ """Profile has an EAPI that is deprecated in the repository."""
328+
329+ _type = 'deprecated'
330+
331+
305332class UnknownCategoryDirs (results .ProfilesResult , results .Warning ):
306333 """Category directories that aren't listed in a repo's categories.
307334
@@ -359,7 +386,7 @@ class RepoProfilesCheck(RepoCheck):
359386 known_results = frozenset ([
360387 ArchesWithoutProfiles , UnusedProfileDirs , NonexistentProfilePath ,
361388 UnknownCategoryDirs , NonexistentCategories , LaggingProfileEapi ,
362- ProfileError , ProfileWarning ,
389+ ProfileError , ProfileWarning , BannedProfileEapi , DeprecatedProfileEapi ,
363390 ])
364391
365392 # known profile status types for the gentoo repo
@@ -401,7 +428,12 @@ def finish(self):
401428 known_status = known_profile_statuses , known_arch = self .arches )
402429 yield from log_reports
403430
431+ banned_eapis = self .repo .config .profile_eapis_banned
432+ deprecated_eapis = self .repo .config .profile_eapis_deprecated
433+
404434 seen_profile_dirs = set ()
435+ banned_profile_eapi = set ()
436+ deprecated_profile_eapi = set ()
405437 lagging_profile_eapi = defaultdict (list )
406438 for p in profiles :
407439 try :
@@ -413,11 +445,19 @@ def finish(self):
413445 seen_profile_dirs .update (dir_parents (parent .name ))
414446 if profile .eapi is not parent .eapi and profile .eapi in parent .eapi .inherits :
415447 lagging_profile_eapi [profile ].append (parent )
448+ if str (parent .eapi ) in banned_eapis :
449+ banned_profile_eapi .add (parent )
450+ if str (parent .eapi ) in deprecated_eapis :
451+ deprecated_profile_eapi .add (parent )
416452
417453 for profile , parents in lagging_profile_eapi .items ():
418454 parent = parents [- 1 ]
419455 yield LaggingProfileEapi (
420456 profile .name , str (profile .eapi ), parent .name , str (parent .eapi ))
457+ for profile in banned_profile_eapi :
458+ yield BannedProfileEapi (profile .name , profile .eapi )
459+ for profile in deprecated_profile_eapi :
460+ yield DeprecatedProfileEapi (profile .name , profile .eapi )
421461
422462 if unused_profile_dirs := available_profile_dirs - seen_profile_dirs :
423463 yield UnusedProfileDirs (sorted (unused_profile_dirs ))
0 commit comments