aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-checkout.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/pkg-checkout.cxx')
-rw-r--r--bpkg/pkg-checkout.cxx50
1 files changed, 19 insertions, 31 deletions
diff --git a/bpkg/pkg-checkout.cxx b/bpkg/pkg-checkout.cxx
index 2a3f508..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;
@@ -133,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 (
@@ -149,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;
+ }
}
}
@@ -171,9 +174,6 @@ namespace bpkg
const repository_location& rl (pl->repository_fragment->location);
auto_rmdir rmd;
- optional<string> mc;
- optional<string> bc;
-
const dir_path& ord (output_root ? *output_root : c);
dir_path d (ord / dir_path (n.string () + '-' + v.string ()));
@@ -311,23 +311,8 @@ namespace bpkg
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 */);
-
- // Calculate the buildfiles checksum if the package has any buildfile
- // clauses in the dependencies.
- //
- // Note that the available package already has all the buildfiles
- // loaded.
- //
- if ((p != nullptr && p->manifest_checksum == mc)
- ? p->buildfiles_checksum.has_value ()
- : has_buildfile_clause (ap->dependencies))
- bc = package_buildfiles_checksum (ap->bootstrap_build,
- ap->root_build,
- ap->buildfiles);
}
if (p != nullptr)
@@ -361,13 +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->buildfiles_checksum = move (bc);
+ p->manifest_checksum = nullopt;
+ p->buildfiles_checksum = nullopt;
pdb.update (p);
}
@@ -387,8 +375,8 @@ namespace bpkg
false,
move (d), // Source root.
purge, // Purge directory.
- move (mc),
- move (bc),
+ nullopt, // No manifest/subprojects checksum.
+ nullopt, // No buildfiles checksum.
nullopt, // No output directory yet.
{}}); // No prerequisites captured yet.