diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-10-22 22:49:19 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-10-31 17:33:32 +0300 |
commit | dad48d98b1a57706179c34853950588ec75a8467 (patch) | |
tree | 307cf55b44e88b2f6cc154c58cc74683040000ca /bpkg/package.hxx | |
parent | 6bbf6390d95941cd5ead6eba649edc2a7fec9d21 (diff) |
Add support for package version constraint in pkg-build command arguments
Also document tests, examples, and benchmarks package manifest values.
Diffstat (limited to 'bpkg/package.hxx')
-rw-r--r-- | bpkg/package.hxx | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 4f40939..a3a6bab 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -442,15 +442,15 @@ namespace bpkg // package" to refer to the "effective" dependency that has been resolved to // the actual package object. // - #pragma db value(dependency_constraint) definition + #pragma db value(version_constraint) definition #pragma db value(dependency) definition #pragma db member(dependency::constraint) column("") #pragma db value(dependency_alternatives) definition using dependencies = vector<dependency_alternatives>; - // Wildcard version. Satisfies any dependency constraint and is represented - // as 0+0 (which is also the "stub version"; since a real version is always + // Wildcard version. Satisfies any version constraint and is represented as + // 0+0 (which is also the "stub version"; since a real version is always // greater than the stub version, we reuse it to signify a special case). // extern const version wildcard_version; @@ -515,7 +515,7 @@ namespace bpkg mutable optional<version_type> system_version_; public: - // Note: dependency constraints must be complete. + // Note: version constraints must be complete. // available_package (package_manifest&& m) : id (move (m.name), m.version), @@ -722,15 +722,32 @@ namespace bpkg const version&, bool system = false); + // Return the package name in the [sys:]<name>[<version-constraint>] form. + // The version constraint component is represented with the "/<version>" + // string for the `== <version>` constraint, "/*" string for the wildcard + // version, and is omitted for nullopt. + // + // If the version constraint other than the equality operator is specified + // for a system package, return the "sys:<name>/..." string (with "..." + // literally). This, in particular, is used for issuing diagnostics that + // advises the user to configure a system package. Note that in this case + // the user can only specify a specific version/wildcard on the command + // line. + // + string + package_string (const package_name& name, + const optional<version_constraint>&, + bool system = false); + // A map of "effective" prerequisites (i.e., pointers to other selected - // packages) to optional dependency constraint. Note that because it is a + // packages) to optional version 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<lazy_shared_ptr<selected_package>, - optional<dependency_constraint>, + optional<version_constraint>, compare_lazy_ptr>; #pragma db object pointer(shared_ptr) session @@ -1048,7 +1065,7 @@ namespace bpkg string name; #pragma db column(pp.value) - optional<dependency_constraint> constraint; + optional<version_constraint> constraint; }; */ @@ -1064,7 +1081,7 @@ namespace bpkg package_name name; #pragma db column("pp.") - optional<dependency_constraint> constraint; + optional<version_constraint> constraint; }; // Return a count of repositories that contain this repository fragment. |