(precs, download_dir, transmute_file_type="")
| 374 | |
| 375 | |
| 376 | def _fetch_precs(precs, download_dir, transmute_file_type=""): |
| 377 | pc_recs = _fetch(download_dir, precs) |
| 378 | # Constructor cache directory can have multiple packages from different |
| 379 | # installer creations. Filter out those which the solver picked. |
| 380 | precs_fns = [x.fn for x in precs] |
| 381 | pc_recs = [x for x in pc_recs if x.fn in precs_fns] |
| 382 | _urls = [(pc_rec.url, pc_rec.md5) for pc_rec in pc_recs] |
| 383 | has_conda = any(pc_rec.name == "conda" for pc_rec in pc_recs) |
| 384 | |
| 385 | dists = list(prec.fn for prec in precs) |
| 386 | |
| 387 | if transmute_file_type != "": |
| 388 | new_dists = [] |
| 389 | import conda_package_handling.api |
| 390 | |
| 391 | for dist in dists: |
| 392 | if dist.endswith(transmute_file_type): |
| 393 | new_dists.append(dist) |
| 394 | elif dist.endswith(".tar.bz2"): |
| 395 | dist = filename_dist(dist) |
| 396 | new_file_name = "%s%s" % (dist[:-8], transmute_file_type) |
| 397 | new_dists.append(new_file_name) |
| 398 | new_file_name = join(download_dir, new_file_name) |
| 399 | if os.path.exists(new_file_name): |
| 400 | continue |
| 401 | logger.info("transmuting %s", dist) |
| 402 | conda_package_handling.api.transmute( |
| 403 | os.path.join(download_dir, dist), |
| 404 | transmute_file_type, |
| 405 | out_folder=download_dir, |
| 406 | ) |
| 407 | else: |
| 408 | new_dists.append(dist) |
| 409 | dists = new_dists |
| 410 | |
| 411 | return pc_recs, _urls, dists, has_conda |
| 412 | |
| 413 | |
| 414 | def _main( |
no test coverage detected