Skip to content

Commit f87c3fe

Browse files
committed
Fix some paths
1 parent f92bb02 commit f87c3fe

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

relenv/build/common/install.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ def update_ensurepip(directory: pathlib.Path) -> None:
334334
urllib3_target_dir = (
335335
bundle_dir
336336
/ pip_whl_extracted
337-
/ f"pip-{pip_version}"
338337
/ "pip"
339338
/ "_vendor"
340339
/ "urllib3"
@@ -373,15 +372,14 @@ def get_record_entry(file_path: PathLike, root_dir: PathLike) -> str:
373372

374373
return f"{rel_path},sha256={hash_base64},{size}"
375374

376-
pip_src_dir = pip_whl_extracted / f"pip-{pip_version}"
377375
# delete existing RECORD file
378-
records_file = pip_src_dir / f"pip-{pip_version}.dist-info" / "RECORD"
376+
records_file = pip_whl_extracted / f"pip-{pip_version}.dist-info" / "RECORD"
379377
records_file.unlink(missing_ok=True)
380378
# create new RECORD file
381-
files_list = [f for f in pip_src_dir.rglob("*") if f.is_file()]
379+
files_list = [f for f in pip_whl_extracted.rglob("*") if f.is_file()]
382380
with open(records_file, "w") as f:
383381
for file in files_list:
384-
f.write(get_record_entry(file, root_dir=pip_src_dir) + "\n")
382+
f.write(get_record_entry(file, root_dir=pip_whl_extracted) + "\n")
385383
# This is the last line. It shouldn't be there because we removed the
386384
# RECORD file before we listed all files
387385
f.write(f"pip-{pip_version}.dist-info/RECORD,,")
@@ -390,10 +388,10 @@ def get_record_entry(file_path: PathLike, root_dir: PathLike) -> str:
390388
# TODO: pack the pip whl
391389
(bundle_dir / pip_whl).unlink(missing_ok=True)
392390
# We need to do this again so we include the RECORD file
393-
files_list = [f for f in pip_src_dir.rglob("*") if f.is_file()]
391+
files_list = [f for f in pip_whl_extracted.rglob("*") if f.is_file()]
394392
with zipfile.ZipFile(bundle_dir / pip_whl, "w", zipfile.ZIP_DEFLATED) as whl_file:
395393
for file in files_list:
396-
arc_name = file.relative_to(pip_src_dir)
394+
arc_name = file.relative_to(pip_whl_extracted)
397395
whl_file.write(file, arc_name)
398396
assert (bundle_dir / pip_whl).exists()
399397

0 commit comments

Comments
 (0)