From 96ead1ec215ff1f99ea587d32395b02db4114184 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Sat, 24 Sep 2022 05:22:27 +0200 Subject: [PATCH] wrapper: move env var name to constants.WRAPPER_ENV_VAR --- constants.py | 1 + wrapper/wrapper.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/constants.py b/constants.py index e418209..27236be 100644 --- a/constants.py +++ b/constants.py @@ -155,6 +155,7 @@ WRAPPER_TYPES = [ 'none', 'docker', ] +WRAPPER_ENV_VAR = 'KUPFERBOOTSTRAP_WRAPPED' MAKEPKG_CMD = [ 'makepkg', diff --git a/wrapper/wrapper.py b/wrapper/wrapper.py index 06d0d23..cd1af05 100644 --- a/wrapper/wrapper.py +++ b/wrapper/wrapper.py @@ -7,7 +7,7 @@ from typing import Protocol from config import config from config.state import dump_file as dump_config_file -from constants import CHROOT_PATHS +from constants import CHROOT_PATHS, WRAPPER_ENV_VAR WRAPPER_PATHS = CHROOT_PATHS | { 'ccache': '/ccache', @@ -99,7 +99,7 @@ class BaseWrapper(Wrapper): raise NotImplementedError() def is_wrapped(self): - return os.getenv('KUPFERBOOTSTRAP_WRAPPED') == self.type.upper() + return os.getenv(WRAPPER_ENV_VAR) == self.type.upper() def get_bind_mounts_default(self, wrapped_config_path: str = None, ssh_dir: str = None, target_home: str = '/root'): wrapped_config_path = wrapped_config_path or self.wrapped_config_path