diff --git a/pmb/build/other.py b/pmb/build/other.py index 85931e17..5911f8f8 100644 --- a/pmb/build/other.py +++ b/pmb/build/other.py @@ -62,7 +62,7 @@ def abuild_overrides(apkbuild: Path): pmb.helpers.run.root(["sh", "-c", f"cat {override_path} >> {apkbuild}"]) -class BuildStatus(enum.StrEnum): +class BuildStatus(enum.Enum): # The binary package is outdated OUTDATED = "outdated" # There is no binary package @@ -72,6 +72,9 @@ class BuildStatus(enum.StrEnum): # Building isn't needed UNNECESSARY = "unnecessary" + def __str__(self) -> str: + return self.value + def necessary(self): return self in [BuildStatus.OUTDATED, BuildStatus.NEW] diff --git a/pmb/core/config.py b/pmb/core/config.py index 8982918e..e05061b3 100644 --- a/pmb/core/config.py +++ b/pmb/core/config.py @@ -26,11 +26,14 @@ class SystemdConfig(enum.Enum): return [e.value for e in SystemdConfig] -class AutoZapConfig(enum.StrEnum): +class AutoZapConfig(enum.Enum): NO = "no" YES = "yes" SILENTLY = "silently" + def __str__(self) -> str: + return self.value + def enabled(self) -> bool: return self != AutoZapConfig.NO