mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +03:00
config: add auto_zap_misconfigured_chroots (MR 2252)
This option will make pmbootstrap automatically zap chroots that are initialized for the wrong channel, making it much faster to switch between edge and systemd. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
af826c671d
commit
c1aa5acdaa
4 changed files with 49 additions and 9 deletions
|
@ -26,6 +26,18 @@ class SystemdConfig(enum.Enum):
|
|||
return [e.value for e in SystemdConfig]
|
||||
|
||||
|
||||
class AutoZapConfig(enum.StrEnum):
|
||||
NO = "no"
|
||||
YES = "yes"
|
||||
SILENTLY = "silently"
|
||||
|
||||
def enabled(self) -> bool:
|
||||
return self != AutoZapConfig.NO
|
||||
|
||||
def noisy(self) -> bool:
|
||||
return self == AutoZapConfig.YES
|
||||
|
||||
|
||||
class Config():
|
||||
aports: List[Path] = [Path(os.path.expanduser("~") +
|
||||
"/.local/var/pmbootstrap/cache_git/pmaports")]
|
||||
|
@ -57,6 +69,8 @@ class Config():
|
|||
ui_extras: bool = False
|
||||
user: str = "user"
|
||||
work: Path = Path(os.path.expanduser("~") + "/.local/var/pmbootstrap")
|
||||
# automatically zap chroots that are for the wrong channel
|
||||
auto_zap_misconfigured_chroots: AutoZapConfig = AutoZapConfig.NO
|
||||
|
||||
providers: Dict[str, str] = { }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue