pacman/repo: update enum members to uppercase (#3076)

This commit is contained in:
codefiles 2025-01-07 15:37:43 -05:00 committed by GitHub
parent fa515dfdc6
commit fd91cbaac1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 9 deletions

View File

@ -836,13 +836,13 @@ class Installer:
pacman_conf = pacman.Config(self.target) pacman_conf = pacman.Config(self.target)
if multilib: if multilib:
info("The multilib flag is set. This system will be installed with the multilib repository enabled.") info("The multilib flag is set. This system will be installed with the multilib repository enabled.")
pacman_conf.enable(pacman.Repo.Multilib) pacman_conf.enable(pacman.Repo.MULTILIB)
else: else:
info("The multilib flag is not set. This system will be installed without multilib repositories enabled.") info("The multilib flag is not set. This system will be installed without multilib repositories enabled.")
if testing: if testing:
info("The testing flag is set. This system will be installed with testing repositories enabled.") info("The testing flag is set. This system will be installed with testing repositories enabled.")
pacman_conf.enable(pacman.Repo.Testing) pacman_conf.enable(pacman.Repo.TESTING)
else: else:
info("The testing flag is not set. This system will be installed without testing repositories enabled.") info("The testing flag is not set. This system will be installed without testing repositories enabled.")

View File

@ -18,13 +18,13 @@ class Config:
if not self.repos: if not self.repos:
return return
if Repo.Testing in self.repos: if Repo.TESTING in self.repos:
if Repo.Multilib in self.repos: if Repo.MULTILIB in self.repos:
repos_pattern = f'({Repo.Multilib.value}|.+-{Repo.Testing.value})' repos_pattern = f'({Repo.MULTILIB.value}|.+-{Repo.TESTING.value})'
else: else:
repos_pattern = f'(?!{Repo.Multilib.value}).+-{Repo.Testing.value}' repos_pattern = f'(?!{Repo.MULTILIB.value}).+-{Repo.TESTING.value}'
else: else:
repos_pattern = Repo.Multilib.value repos_pattern = Repo.MULTILIB.value
pattern = re.compile(rf"^#\s*\[{repos_pattern}\]$") pattern = re.compile(rf"^#\s*\[{repos_pattern}\]$")

View File

@ -2,5 +2,5 @@ from enum import Enum
class Repo(Enum): class Repo(Enum):
Multilib = "multilib" MULTILIB = "multilib"
Testing = "testing" TESTING = "testing"