diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-21 21:40:28 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-04-19 19:39:55 +0300 |
commit | 15dff3c592385466406732cd6ced809dc28cf2e2 (patch) | |
tree | 1da9f0738293eb7906d92ab010a79c689087b655 /bpkg/package.hxx | |
parent | 46842f6cf74d085ced382dd0c187f6a7a578913c (diff) |
Implement build plan simulation
Diffstat (limited to 'bpkg/package.hxx')
-rw-r--r-- | bpkg/package.hxx | 33 |
1 files changed, 31 insertions, 2 deletions
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<available_package>&, bool prereq = true); + vector<shared_ptr<available_package>> + filter (const vector<shared_ptr<repository>>&, + odb::result<available_package>&&, + 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<string> 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 |