mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 11:36:32 +01:00
fix(stage0-image): preserve runtime /steps/env while syncing step sources
This commit is contained in:
parent
886d5a5237
commit
d5fc082dab
1 changed files with 8 additions and 0 deletions
|
|
@ -95,6 +95,11 @@ mirrors = sys.argv[8:]
|
|||
old_config_path = os.path.join(mountpoint, "steps", "bootstrap.cfg")
|
||||
if not os.path.isfile(old_config_path):
|
||||
raise SystemExit(f"Missing config in stage0 image: {old_config_path}")
|
||||
old_env_path = os.path.join(mountpoint, "steps", "env")
|
||||
old_env_content = None
|
||||
if os.path.isfile(old_env_path):
|
||||
with open(old_env_path, "rb") as env_file:
|
||||
old_env_content = env_file.read()
|
||||
|
||||
with open(old_config_path, "r", encoding="utf-8") as cfg:
|
||||
lines = [
|
||||
|
|
@ -111,6 +116,9 @@ if os.path.isdir(dest_steps):
|
|||
shutil.copytree(steps_dir, dest_steps, dirs_exist_ok=True)
|
||||
else:
|
||||
shutil.copytree(steps_dir, dest_steps)
|
||||
if old_env_content is not None:
|
||||
with open(os.path.join(dest_steps, "env"), "wb") as env_file:
|
||||
env_file.write(old_env_content)
|
||||
|
||||
config_path = os.path.join(dest_steps, "bootstrap.cfg")
|
||||
if build_guix_also:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue