Skip to content
Snippets Groups Projects
Commit dd1718d4 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

run: copy data env in a dedicated empty directory

This will avoid picky the temporary copy as a valid data env by mistake.
parent 8ac4768d
No related branches found
No related tags found
Loading
......@@ -97,11 +97,13 @@
do_snapshot = NO_SNAPSHOT
if reference.parent == tmp.parent:
do_snapshot = _may_snapshot(reference)
if BTRFS_DEBUG and do_snapshot == COULD_SNAPSHOT_BUT_NOT_SUBVOLUME:
m = "skipping btrfs snapshot: data env not a subvolume"
print(m, file=sys.stderr)
# IMPORTANT NOTE: here assume we always copy the data env on the same file
# system as the source. It is important regarless of using btrfs so we can
# assume this will remains the case in the future.
do_snapshot = _may_snapshot(reference)
if BTRFS_DEBUG and do_snapshot == COULD_SNAPSHOT_BUT_NOT_SUBVOLUME:
m = "skipping btrfs snapshot: data env not a subvolume"
print(m, file=sys.stderr)
start = time.monotonic()
if do_snapshot in COPY_AS_SNAPSHOT:
......@@ -171,7 +173,9 @@
tmp_data = None
if run_in_copy:
tmp_data = data_env_path.parent / f"TMP-{data_env_path.name}"
tmp_dir = data_env_path.parent / ".tmp/"
os.makedirs(tmp_dir, exist_ok=True)
tmp_data = tmp_dir / data_env_path.name
copy_data_env(data_env_path, tmp_data)
data_env_path = tmp_data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment