File tree Expand file tree Collapse file tree
data/repos/profiledir/RepoProfilesCheck/ArchesOutOfSync
repos/profiledir/profiles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -498,6 +498,20 @@ def desc(self):
498498 return f"nonexistent profiles/categories entr{ ies } : { categories } "
499499
500500
501+ class ArchesOutOfSync (results .ProfilesResult , results .Error ):
502+ """``profiles/arches.desc`` is out of sync with ``arch.list``."""
503+
504+ def __init__ (self , arches ):
505+ super ().__init__ ()
506+ self .arches = tuple (arches )
507+
508+ @property
509+ def desc (self ):
510+ es = pluralism (self .arches , plural = "es" )
511+ arches = ", " .join (self .arches )
512+ return f"'profiles/arches.desc' is out of sync with 'arch.list', arch{ es } : { arches } "
513+
514+
501515def dir_parents (path ):
502516 """Yield all directory path parents excluding the root directory.
503517
@@ -533,6 +547,7 @@ class RepoProfilesCheck(RepoCheck):
533547 ProfileWarning ,
534548 BannedProfileEapi ,
535549 DeprecatedProfileEapi ,
550+ ArchesOutOfSync ,
536551 ]
537552 )
538553
@@ -614,3 +629,7 @@ def finish(self):
614629
615630 if unused_profile_dirs := available_profile_dirs - seen_profile_dirs :
616631 yield UnusedProfileDirs (sorted (unused_profile_dirs ))
632+
633+ if arches_desc := frozenset ().union (* self .repo .config .arches_desc .values ()):
634+ if arches_mis_sync := self .repo .known_arches ^ arches_desc :
635+ yield ArchesOutOfSync (sorted (arches_mis_sync ))
Original file line number Diff line number Diff line change 1+ {"__class__" : " ArchesOutOfSync" , "arches" : [" unknown_arch" ]}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ sed -i ' /^unknown_arch/d' profiles/arch.list
Original file line number Diff line number Diff line change 1+ amd64 stable
2+ x86 testing
You can’t perform that action at this time.
0 commit comments