From 309cccfffc15657dd8654aa6a14e444bb47417ae Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 21 Feb 2022 22:54:05 +0300 Subject: Increment version iteration for external packages on buildfiles change --- bpkg/pkg-checkout.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bpkg/pkg-checkout.cxx') diff --git a/bpkg/pkg-checkout.cxx b/bpkg/pkg-checkout.cxx index 61561e2..f2c373d 100644 --- a/bpkg/pkg-checkout.cxx +++ b/bpkg/pkg-checkout.cxx @@ -169,6 +169,7 @@ namespace bpkg auto_rmdir rmd; optional mc; + optional bc; const dir_path& ord (output_root ? *output_root : c); dir_path d (ord / dir_path (n.string () + '-' + v.string ())); @@ -311,6 +312,16 @@ namespace bpkg bspec); mc = package_checksum (o, d, nullptr /* package_info */); + + // Calculate the buildfiles checksum if the package has any buildfile + // clauses in the dependencies. + // + 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, + d); } if (p != nullptr) @@ -350,6 +361,7 @@ namespace bpkg p->src_root = move (d); p->purge_src = purge; p->manifest_checksum = move (mc); + p->buildfiles_checksum = move (bc); pdb.update (p); } @@ -370,6 +382,7 @@ namespace bpkg move (d), // Source root. purge, // Purge directory. move (mc), + move (bc), nullopt, // No output directory yet. {}}); // No prerequisites captured yet. -- cgit v1.1