@@ -11,7 +11,7 @@ using UUIDs
1111export temp_pkg_dir, cd_tempdir, isinstalled, write_build, with_current_env,
1212 with_temp_env, with_pkg_env, git_init_and_commit, copy_test_package,
1313 git_init_package, add_this_pkg, TEST_SIG, TEST_PKG, isolate, LOADED_DEPOT,
14- list_tarball_files, recursive_rm_cov_files
14+ list_tarball_files, recursive_rm_cov_files, copy_this_pkg_cache
1515
1616const CACHE_DIRECTORY = realpath (mktempdir (; cleanup = true ))
1717
@@ -22,6 +22,17 @@ const REGISTRY_DIR = joinpath(REGISTRY_DEPOT, "registries", "General")
2222
2323const GENERAL_UUID = UUID (" 23338594-aafe-5451-b93e-139f81909106" )
2424
25+ function copy_this_pkg_cache (new_depot)
26+ for p in (" Pkg" , " REPLExt" )
27+ subdir = joinpath (" compiled" , " v$(VERSION . major) .$(VERSION . minor) " )
28+ source = joinpath (Base. DEPOT_PATH [1 ], subdir, p)
29+ isdir (source) || continue # doesn't exist if using shipped Pkg (e.g. Julia CI)
30+ dest = joinpath (new_depot, subdir, p)
31+ mkpath (dirname (dest))
32+ cp (source, dest)
33+ end
34+ end
35+
2536function check_init_reg ()
2637 isfile (joinpath (REGISTRY_DIR, " Registry.toml" )) && return
2738 mkpath (REGISTRY_DIR)
0 commit comments