diff --git a/acbs/main.py b/acbs/main.py index 61a1d43..dcbd993 100644 --- a/acbs/main.py +++ b/acbs/main.py @@ -24,7 +24,6 @@ ACBSLogFormatter, ACBSLogPlainFormatter, check_artifact, - detect_nspawn, full_line_banner, generate_checksums, guess_subdir, @@ -41,12 +40,6 @@ CIEL_LOCK_PATH = '/debs/fresh.lock' -# Git config to treat the ABBS tree as "safe directory". -GIT_CONFIG_SAFEDIR = """ -[safe] -\tdirectory = /tree -""" - def ciel_invalidate_cache(): logging.info('Asking ciel to refresh repository...') if os.path.exists(CIEL_LOCK_PATH): @@ -156,14 +149,6 @@ def init(self) -> None: else: raise Exception('forest.conf not found') - # Install a git config file to allow dubious ownership in /tree. - if detect_nspawn(): - try: - with open("/root/.gitconfig", 'w+') as f: - f.writelines(GIT_CONFIG_SAFEDIR) - except Exception as e: - logging.warning("Unable to install git config file: {}, skipping.".format(e)) - def __install_logger(self, str_verbosity=logging.INFO, file_verbosity=logging.DEBUG): logger = logging.getLogger() diff --git a/acbs/utils.py b/acbs/utils.py index 7f51166..b0d8e71 100644 --- a/acbs/utils.py +++ b/acbs/utils.py @@ -438,16 +438,3 @@ def format(self, record): logging.INFO, logging.DEBUG): record.msg = f'[{lvl_map[record.levelname]}]: {record.msg}' return super(ACBSLogFormatter, self).format(record) - -def detect_nspawn() -> bool: - try: - with open("/run/systemd/container", "r") as f: - content = f.readline() - if content.strip() == "systemd-nspawn": - return True - except FileNotFoundError: - return False - except Exception as e: - logging.warning("Unable to detect containerization: {}, assuming false.".format(e)) - return False - return False