Skip to content

Commit

Permalink
pacman/repo: use StrEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Jan 7, 2025
1 parent 10a12dc commit 5366b60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions archinstall/lib/pacman/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def apply(self) -> None:

if Repo.TESTING in self.repos:
if Repo.MULTILIB in self.repos:
repos_pattern = f'({Repo.MULTILIB.value}|.+-{Repo.TESTING.value})'
repos_pattern = f'({Repo.MULTILIB}|.+-{Repo.TESTING})'
else:
repos_pattern = f'(?!{Repo.MULTILIB.value}).+-{Repo.TESTING.value}'
repos_pattern = f'(?!{Repo.MULTILIB}).+-{Repo.TESTING}'
else:
repos_pattern = Repo.MULTILIB.value
repos_pattern = Repo.MULTILIB

pattern = re.compile(rf"^#\s*\[{repos_pattern}\]$")

Expand Down
8 changes: 4 additions & 4 deletions archinstall/lib/pacman/repo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum
from enum import StrEnum, auto


class Repo(Enum):
MULTILIB = "multilib"
TESTING = "testing"
class Repo(StrEnum):
MULTILIB = auto()
TESTING = auto()

0 comments on commit 5366b60

Please sign in to comment.