Skip to content

Commit

Permalink
Partially revert "acbs: treat /tree as a "safe directory""
Browse files Browse the repository at this point in the history
The installation part should be handled by Ciel (while configuring Ciel
containers), not ACBS. ACBS still passes safe.directory option to Git
command line.
This reverts commit 21a8784.
  • Loading branch information
Cyanoxygen committed Dec 2, 2024
1 parent 21a8784 commit c3a3815
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
15 changes: 0 additions & 15 deletions acbs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
ACBSLogFormatter,
ACBSLogPlainFormatter,
check_artifact,
detect_nspawn,
full_line_banner,
generate_checksums,
guess_subdir,
Expand All @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
13 changes: 0 additions & 13 deletions acbs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c3a3815

Please sign in to comment.