Skip to content

Commit c95ca81

Browse files
K2GO-443 fix(code-assets): aria2 per-entry dir= so files land in serve subdirs
aria2 did not honor an out= that contains a subdir: it wrote to the -d root. That also collided the v7/v8 same-named android-sdk/bootstrap files. Emit an absolute per-entry dir= plus a basename out= so each file keeps its subdir.
1 parent e1365fb commit c95ca81

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎tools/upstream-patches/overlays/roles/code_assets/files/mirror_code_assets.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,12 @@ def aria2_input(source_base, out, manifest_path=MANIFEST_DEFAULT, reuse_from=Non
387387
if reuse_ok[p]:
388388
shutil.copyfile(reuse_from / p, dest) # unchanged: stage from the served tree, no download
389389
else:
390+
# aria2 does not reliably place a file from an out= that contains a subdir (on device it
391+
# wrote to the -d root, which would also collide the v7/v8 same-named files). Use an absolute
392+
# per-entry dir= plus a basename out=, so each file lands in its serve-relative subdir.
390393
lines.append(f"{source_base}/{p}")
391-
lines.append(f" out={p}")
394+
lines.append(f" dir={out}/{Path(p).parent}")
395+
lines.append(f" out={Path(p).name}")
392396
if want is not None:
393397
lines.append(f" checksum=md5={want}")
394398
sys.stdout.write("\n".join(lines) + "\n")

0 commit comments

Comments
 (0)