aboutsummaryrefslogtreecommitdiff
path: root/libbpkg/manifest.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-01-12 21:51:27 +0300
committerBoris Kolpackov <boris@codesynthesis.com>2023-02-01 11:30:06 +0200
commit209a5d12d829adcf7bff48d64c436a8c0ff4b30e (patch)
tree952a2046fc0732db195888b790aa57ed078dd33c /libbpkg/manifest.hxx
parent3251fe0b1793ee0b1897ec595f9a9e8f9f484a7b (diff)
Add *-name, *-version, and *-to-downstream-version package manifest values
Diffstat (limited to 'libbpkg/manifest.hxx')
-rw-r--r--libbpkg/manifest.hxx76
1 files changed, 57 insertions, 19 deletions
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx
index 0fd5feb..6779881 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, <distribution>-version, etc.
+
+ require_location = 0x020,
+ require_sha256sum = 0x040,
+ require_description_type = 0x080,
+ require_bootstrap_build = 0x100
};
inline package_manifest_flags
@@ -1130,6 +1130,40 @@ namespace bpkg
content (std::move (c)) {}
};
+ // Binary distribution package information.
+ //
+ // The name is prefixed with the <distribution> id, typically name/version
+ // pair in the <name>[_<version>] form. For example:
+ //
+ // debian-name
+ // debian_10-name
+ // ubuntu_20.04-name
+ //
+ // Currently recognized names:
+ //
+ // <distribution>-name
+ // <distribution>-version
+ // <distribution>-to-downstream-version
+ //
+ // Note that the value format/semantics can be distribution-specific.
+ //
+ struct LIBBPKG_EXPORT 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)) {}
+
+ // Return the name's <distribution> component if the name has the
+ // specified suffix, which is assumed to be valid (-name, etc).
+ //
+ butl::optional<std::string>
+ distribution (const std::string& suffix) const;
+ };
+
class LIBBPKG_EXPORT package_manifest
{
public:
@@ -1189,6 +1223,10 @@ namespace bpkg
std::vector<buildfile> buildfiles; // Buildfiles content.
std::vector<butl::path> buildfile_paths;
+ // The binary distributions package information.
+ //
+ std::vector<distribution_name_value> distribution_values;
+
// The following values are only valid in the manifest list (and only for
// certain repository types).
//
@@ -1220,7 +1258,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 +1280,7 @@ namespace bpkg
package_manifest (butl::manifest_parser&,
const std::function<translate_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 +1295,7 @@ namespace bpkg
package_manifest (const std::string& name,
std::vector<butl::manifest_name_value>&&,
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 +1305,7 @@ namespace bpkg
std::vector<butl::manifest_name_value>&&,
const std::function<translate_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 +1316,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 +1420,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