From 8cb3544c88bdbd4da9f1f4962ad2fe9ff741ef2e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 12 Jan 2023 21:51:27 +0300 Subject: Add *-name, *-version, and *-to-downstream-version package manifest values --- libbpkg/manifest.hxx | 63 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 19 deletions(-) (limited to 'libbpkg/manifest.hxx') diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 0fd5feb..120884a 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -811,18 +811,18 @@ namespace bpkg // enum class package_manifest_flags: std::uint16_t { - none = 0x000, - - forbid_file = 0x001, // Forbid *-file manifest values. - forbid_location = 0x002, - forbid_sha256sum = 0x004, - forbid_fragment = 0x008, - forbid_incomplete_dependencies = 0x010, - - require_location = 0x020, - require_sha256sum = 0x040, - require_description_type = 0x080, - require_bootstrap_build = 0x100 + none = 0x000, + + forbid_file = 0x001, // Forbid *-file manifest values. + forbid_location = 0x002, + forbid_sha256sum = 0x004, + forbid_fragment = 0x008, + forbid_incomplete_values = 0x010, // depends, -version, etc. + + require_location = 0x020, + require_sha256sum = 0x040, + require_description_type = 0x080, + require_bootstrap_build = 0x100 }; inline package_manifest_flags @@ -1130,6 +1130,27 @@ namespace bpkg content (std::move (c)) {} }; + // Binary distribution package information. + // + // The name is prefixed with the distribution name/version and has the + // `[_]-*` form. For example: + // + // debian + // debian_10 + // + // Note that the value semantics can be distribution-specific. + // + struct distribution_name_value + { + std::string name; + std::string value; + + distribution_name_value () = default; + distribution_name_value (std::string n, std::string v) + : name (std::move (n)), + value (std::move (v)) {} + }; + class LIBBPKG_EXPORT package_manifest { public: @@ -1189,6 +1210,10 @@ namespace bpkg std::vector buildfiles; // Buildfiles content. std::vector buildfile_paths; + // The binary distributions package information. + // + std::vector distributions; + // The following values are only valid in the manifest list (and only for // certain repository types). // @@ -1220,7 +1245,7 @@ namespace bpkg // package_manifest (butl::manifest_parser&, bool ignore_unknown = false, - bool complete_dependencies = true, + bool complete_values = true, package_manifest_flags = package_manifest_flags::forbid_location | package_manifest_flags::forbid_sha256sum | @@ -1242,7 +1267,7 @@ namespace bpkg package_manifest (butl::manifest_parser&, const std::function&, bool ignore_unknown = false, - bool complete_depends = true, + bool complete_values = true, package_manifest_flags = package_manifest_flags::forbid_location | package_manifest_flags::forbid_sha256sum | @@ -1257,7 +1282,7 @@ namespace bpkg package_manifest (const std::string& name, std::vector&&, bool ignore_unknown = false, - bool complete_dependencies = true, + bool complete_values = true, package_manifest_flags = package_manifest_flags::forbid_location | package_manifest_flags::forbid_sha256sum | @@ -1267,7 +1292,7 @@ namespace bpkg std::vector&&, const std::function&, bool ignore_unknown = false, - bool complete_depends = true, + bool complete_values = true, package_manifest_flags = package_manifest_flags::forbid_location | package_manifest_flags::forbid_sha256sum | @@ -1278,7 +1303,7 @@ namespace bpkg package_manifest (butl::manifest_parser&, butl::manifest_name_value start, bool ignore_unknown, - bool complete_depends, + bool complete_values, package_manifest_flags); // Override manifest values with the specified. Throw manifest_parsing if @@ -1382,9 +1407,9 @@ namespace bpkg inline package_manifest pkg_package_manifest (butl::manifest_parser& p, bool ignore_unknown = false, - bool complete_depends = true) + bool complete_values = true) { - return package_manifest (p, ignore_unknown, complete_depends); + return package_manifest (p, ignore_unknown, complete_values); } LIBBPKG_EXPORT package_manifest -- cgit v1.1