From 15dff3c592385466406732cd6ced809dc28cf2e2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 21 Mar 2018 21:40:28 +0300 Subject: Implement build plan simulation --- bpkg/package.hxx | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'bpkg/package.hxx') diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 58338bd..49c6bd0 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -484,7 +484,7 @@ namespace bpkg operator size_t () const {return result;} }; - // Only return packages that are in the specified repository, its + // Only return packages that are in the specified repositories, their // complements or prerequisites (if prereq is true), recursively. While you // could maybe come up with a (barely comprehensible) view/query to achieve // this, doing it on the "client side" is definitely more straightforward. @@ -504,6 +504,11 @@ namespace bpkg const shared_ptr&, bool prereq = true); + vector> + filter (const vector>&, + odb::result&&, + bool prereq = true); + // package_state // enum class package_state @@ -613,7 +618,11 @@ namespace bpkg bool purge_src; // The checksum of the manifest file located in the source directory. - // Must be present if the source directory is present. + // + // Must be present if the source directory is present, unless the object + // is created/updated during the package build simulation (see pkg-build + // for details). Note that during the simulation the manifest may not be + // available. // optional manifest_checksum; @@ -659,6 +668,26 @@ namespace bpkg string version_string () const; + // Return the relative source directory completed using the configuration + // directory. Return the absolute source directory as is. + // + dir_path + effective_src_root (const dir_path& configuration) const + { + assert (src_root); + return src_root->absolute () ? *src_root : configuration / *src_root; + } + + // Return the output directory using the configuration directory. Note + // that the output directory is always relative. + // + dir_path + effective_out_root (const dir_path& configuration) const + { + assert (out_root); + return configuration / *out_root; + } + // Database mapping. // #pragma db member(name) id -- cgit v1.1