diff options
Diffstat (limited to 'bpkg/pkg-checkout.cxx')
-rw-r--r-- | bpkg/pkg-checkout.cxx | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/bpkg/pkg-checkout.cxx b/bpkg/pkg-checkout.cxx index 49fc89f..81efdc2 100644 --- a/bpkg/pkg-checkout.cxx +++ b/bpkg/pkg-checkout.cxx @@ -10,12 +10,12 @@ #include <bpkg/package-odb.hxx> #include <bpkg/database.hxx> #include <bpkg/checksum.hxx> +#include <bpkg/rep-mask.hxx> #include <bpkg/diagnostics.hxx> #include <bpkg/manifest-utility.hxx> #include <bpkg/pkg-purge.hxx> #include <bpkg/pkg-verify.hxx> -#include <bpkg/pkg-configure.hxx> using namespace std; using namespace butl; @@ -44,7 +44,7 @@ namespace bpkg // Print the progress indicator to attribute the possible fetching // progress. // - if (verb && !o.no_progress ()) + if ((verb && !o.no_progress ()) || o.progress ()) text << "checking out " << package_string (ap->id.name, ap->version) << db; @@ -74,6 +74,9 @@ namespace bpkg { case repository_type::git: { + if (!revert && !ie) + git_verify_symlinks (o, dir); + r = git_fixup_worktree (o, dir, revert, ie); break; } @@ -130,7 +133,7 @@ namespace bpkg check_any_available (rdb, t); - // Note that here we compare including the revision (see pkg-fetch() + // Note that here we compare including the revision (see pkg_fetch() // implementation for more details). // shared_ptr<available_package> ap ( @@ -146,14 +149,17 @@ namespace bpkg for (const package_location& l: ap->locations) { - const repository_location& rl (l.repository_fragment.load ()->location); - - if (rl.version_control_based () && (pl == nullptr || rl.local ())) + if (!rep_masked_fragment (l.repository_fragment)) { - pl = &l; + const repository_location& rl (l.repository_fragment.load ()->location); + + if (rl.version_control_based () && (pl == nullptr || rl.local ())) + { + pl = &l; - if (rl.local ()) - break; + if (rl.local ()) + break; + } } } @@ -168,8 +174,6 @@ namespace bpkg const repository_location& rl (pl->repository_fragment->location); auto_rmdir rmd; - optional<string> mc; - const dir_path& ord (output_root ? *output_root : c); dir_path d (ord / dir_path (n.string () + '-' + v.string ())); @@ -196,8 +200,8 @@ namespace bpkg // of it (note that if they appear on different filesystems that won't // be possible). // - auto ti (temp_dir.find (rdb.config_orig)); - assert (ti != temp_dir.end ()); + auto ti (tmp_dirs.find (rdb.config_orig)); + assert (ti != tmp_dirs.end ()); const dir_path& tdir (ti->second); // Try to reuse the cached repository (moved to the temporary directory @@ -223,7 +227,7 @@ namespace bpkg // The repository temporary directory. // - auto_rmdir rmt (tdir / sd); + auto_rmdir rmt (tdir / sd, !keep_tmp); // Move the repository to the temporary directory. // @@ -257,7 +261,7 @@ namespace bpkg // The temporary out of source directory that is required for the dist // meta-operation. // - auto_rmdir rmo (tdir / dir_path (n.string ())); + auto_rmdir rmo (tdir / dir_path (n.string ()), !keep_tmp); const dir_path& od (rmo.path); if (exists (od)) @@ -297,20 +301,18 @@ namespace bpkg // of our dependencies. // - // At verbosity level 1 we want our (nicer) progress header but the - // build system's actual progress. + // If the verbosity level is less than 2, then we want our (nicer) + // progress header but the build system's actual progress. // - if (verb == 1 && !o.no_progress ()) + if ((verb == 1 && !o.no_progress ()) || (verb == 0 && o.progress ())) text << "distributing " << n << '/' << v << pdb; run_b (o, verb_b::progress, "--no-external-modules", "!config.dist.bootstrap=true", - "config.dist.root='" + ord.representation () + "'", + "config.dist.root='" + ord.representation () + '\'', bspec); - - mc = package_checksum (o, d, nullptr /* package_info */); } if (p != nullptr) @@ -344,12 +346,16 @@ namespace bpkg if (p != nullptr) { + // Note: we can be replacing an external package and thus we reset the + // manifest/subprojects and buildfiles checksums. + // p->version = move (v); p->state = package_state::unpacked; p->repository_fragment = rl; p->src_root = move (d); p->purge_src = purge; - p->manifest_checksum = move (mc); + p->manifest_checksum = nullopt; + p->buildfiles_checksum = nullopt; pdb.update (p); } @@ -369,7 +375,8 @@ namespace bpkg false, move (d), // Source root. purge, // Purge directory. - move (mc), + nullopt, // No manifest/subprojects checksum. + nullopt, // No buildfiles checksum. nullopt, // No output directory yet. {}}); // No prerequisites captured yet. |