From 89dd478de7cf075beac69d0145df46f914cf35cf Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 19 Feb 2018 21:47:04 +0300 Subject: Add support for pkg-checkout --- bpkg/package.hxx | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'bpkg/package.hxx') diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 67b1753..41e8bd6 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -41,8 +41,11 @@ namespace bpkg using optional_path = optional; using optional_dir_path = optional; + // In some contexts it may denote directory, so lets preserve the trailing + // slash, if present. + // #pragma db map type(path) as(string) \ - to((?).string ()) from(bpkg::path (?)) + to((?).representation ()) from(bpkg::path (?)) #pragma db map type(optional_path) as(bpkg::optional_string) \ to((?) ? (?)->string () : bpkg::optional_string ()) \ @@ -290,8 +293,15 @@ namespace bpkg { using repository_type = bpkg::repository; + // State is the repository type-specific information that can be used + // to identify the repository state this package came from. For example, + // for a version control-based repository this could be a commit id. + // + // The localtion is the package location within this repository state. + // lazy_shared_ptr repository; - path location; // Relative to the repository. + string state; + path location; }; // dependencies @@ -526,6 +536,17 @@ namespace bpkg // package // + // A map of "effective" prerequisites (i.e., pointers to other selected + // packages) to optional dependency constraint. Note that because it is a + // single constraint, we don't support multiple dependencies on the same + // package (e.g., two ranges of versions). See pkg_configure(). + // + class selected_package; + + using package_prerequisites = std::map, + optional, + compare_lazy_ptr>; + #pragma db object pointer(shared_ptr) session class selected_package { @@ -585,15 +606,7 @@ namespace bpkg // optional out_root; - // A map of "effective" prerequisites (i.e., pointers to other selected - // packages) to optional dependency constraint. Note that because it is a - // single constraint, we don't support multiple dependencies on the same - // package (e.g., two ranges of versions). See pkg_configure(). - // - using prerequisites_type = std::map, - optional, - compare_lazy_ptr>; - prerequisites_type prerequisites; + package_prerequisites prerequisites; bool system () const -- cgit v1.1