|
2 | 2 |
|
3 | 3 | module Operations |
4 | 4 |
|
5 | | -using FileWatching: FileWatching |
6 | | -using UUIDs |
| 5 | +import Dates |
| 6 | +import FileWatching |
| 7 | +import LibGit2 |
| 8 | +import TOML |
7 | 9 | using Random: randstring |
8 | | -import LibGit2, Dates, TOML |
| 10 | +using UUIDs: UUID |
9 | 11 |
|
10 | | -using ..Types, ..Resolve, ..PlatformEngines, ..GitTools, ..MiniProgressBars |
11 | | -import ..depots, ..depots1, ..devdir, ..set_readonly, ..Types.PackageEntry |
12 | | -import ..Artifacts: ensure_artifact_installed, artifact_names, extract_all_hashes, |
13 | | - artifact_exists, select_downloadable_artifacts, mv_temp_dir_retries |
14 | 12 | using Base.BinaryPlatforms |
| 13 | + |
15 | 14 | import ...Pkg |
16 | | -import ...Pkg: pkg_server, Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE |
| 15 | +import ...Pkg: Registry, pathrepr, can_fancyprint, printpkgstyle, stderr_f, OFFLINE_MODE |
17 | 16 | import ...Pkg: UPDATED_REGISTRY_THIS_SESSION, RESPECT_SYSIMAGE_VERSIONS, should_autoprecompile |
18 | 17 | import ...Pkg: usable_io, discover_repo |
| 18 | +import ..depots1, ..devdir, ..set_readonly, ..Types.PackageEntry |
| 19 | +import ..Artifacts: ensure_artifact_installed, artifact_names, |
| 20 | + artifact_exists, select_downloadable_artifacts, mv_temp_dir_retries |
| 21 | +using ..Types, ..Resolve, ..PlatformEngines, ..GitTools, ..MiniProgressBars |
19 | 22 |
|
20 | 23 | ######### |
21 | 24 | # Utils # |
@@ -61,7 +64,7 @@ function find_installed(name::String, uuid::UUID, sha1::SHA1) |
61 | 64 | slug_default = Base.version_slug(uuid, sha1) |
62 | 65 | # 4 used to be the default so look there first |
63 | 66 | for slug in (slug_default, Base.version_slug(uuid, sha1, 4)) |
64 | | - for depot in depots() |
| 67 | + for depot in Base.DEPOT_PATH |
65 | 68 | path = abspath(depot, "packages", name, slug) |
66 | 69 | ispath(path) && return path |
67 | 70 | end |
|
222 | 225 | function is_instantiated(env::EnvCache, workspace::Bool = false; platform = HostPlatform())::Bool |
223 | 226 | # Load everything |
224 | 227 | if workspace |
225 | | - pkgs = Operations.load_all_deps(env) |
| 228 | + pkgs = load_all_deps(env) |
226 | 229 | else |
227 | | - pkgs = Operations.load_all_deps_loadable(env) |
| 230 | + pkgs = load_all_deps_loadable(env) |
228 | 231 | end |
229 | 232 | # If the top-level project is a package, ensure it is instantiated as well |
230 | 233 | if env.pkg !== nothing |
@@ -913,8 +916,8 @@ function install_git( |
913 | 916 | GitTools.checkout_tree_to_path(repo, tree, version_path) |
914 | 917 | return |
915 | 918 | finally |
916 | | - repo !== nothing && LibGit2.close(repo) |
917 | | - tree !== nothing && LibGit2.close(tree) |
| 919 | + repo !== nothing && close(repo) |
| 920 | + tree !== nothing && close(tree) |
918 | 921 | end |
919 | 922 | end |
920 | 923 |
|
@@ -2704,8 +2707,8 @@ function stat_rep(x::PackageSpec; name = true) |
2704 | 2707 | rev = occursin(r"\b([a-f0-9]{40})\b", x.repo.rev) ? x.repo.rev[1:7] : x.repo.rev |
2705 | 2708 | end |
2706 | 2709 | subdir_str = x.repo.subdir === nothing ? "" : ":$(x.repo.subdir)" |
2707 | | - repo = Operations.is_tracking_repo(x) ? "`$(x.repo.source)$(subdir_str)#$(rev)`" : "" |
2708 | | - path = Operations.is_tracking_path(x) ? "$(pathrepr(x.path))" : "" |
| 2710 | + repo = is_tracking_repo(x) ? "`$(x.repo.source)$(subdir_str)#$(rev)`" : "" |
| 2711 | + path = is_tracking_path(x) ? "$(pathrepr(x.path))" : "" |
2709 | 2712 | pinned = x.pinned ? "⚲" : "" |
2710 | 2713 | return join(filter(!isempty, [name, version, repo, path, pinned]), " ") |
2711 | 2714 | end |
@@ -2989,7 +2992,7 @@ function print_status( |
2989 | 2992 |
|
2990 | 2993 | pkg_downloaded = !is_instantiated(new) || is_package_downloaded(env.manifest_file, new) |
2991 | 2994 |
|
2992 | | - new_ver_avail = !latest_version && !Operations.is_tracking_repo(new) && !Operations.is_tracking_path(new) |
| 2995 | + new_ver_avail = !latest_version && !is_tracking_repo(new) && !is_tracking_path(new) |
2993 | 2996 | pkg_upgradable = new_ver_avail && cinfo !== nothing && isempty(cinfo[1]) |
2994 | 2997 | pkg_heldback = new_ver_avail && cinfo !== nothing && !isempty(cinfo[1]) |
2995 | 2998 |
|
|
0 commit comments