(info: dict, dst_dir: str)
| 278 | |
| 279 | |
| 280 | def write_repodata_record(info: dict, dst_dir: str): |
| 281 | all_dists = info["_dists"].copy() |
| 282 | for env_data in info.get("_extra_envs_info", {}).values(): |
| 283 | all_dists += env_data["_dists"] |
| 284 | for dist in all_dists: |
| 285 | if filename_dist(dist).endswith(".conda"): |
| 286 | _dist = filename_dist(dist)[:-6] |
| 287 | elif filename_dist(dist).endswith(".tar.bz2"): |
| 288 | _dist = filename_dist(dist)[:-8] |
| 289 | record_file = join(_dist, "info", "repodata_record.json") |
| 290 | record_file_src = join(info["_download_dir"], record_file) |
| 291 | |
| 292 | with open(record_file_src) as rf: |
| 293 | rr_json = json.load(rf) |
| 294 | |
| 295 | rr_json["url"] = get_final_url(info, rr_json["url"]) |
| 296 | rr_json["channel"] = get_final_url(info, rr_json["channel"]) |
| 297 | |
| 298 | if not isdir(join(dst_dir, _dist, "info")): |
| 299 | os.makedirs(join(dst_dir, _dist, "info")) |
| 300 | |
| 301 | record_file_dest = join(dst_dir, record_file) |
| 302 | |
| 303 | with open(record_file_dest, "w") as rf: |
| 304 | json.dump(rr_json, rf, indent=2, sort_keys=True) |
| 305 | |
| 306 | |
| 307 | def write_initial_state_explicit_txt(info: dict, dst_dir: str, urls: tuple[str, str]): |
no test coverage detected