diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-10-06 19:07:54 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-10-07 13:19:36 +0300 |
commit | fa2704b826f95bc40651da39c3210bf76aeceda4 (patch) | |
tree | 0d6fa2684b57ab4dbd4440fcc02e62c4144df46e /libbpkg/manifest.hxx | |
parent | 27c616e238b6891cd0fe4081d614e6b5c1f977bb (diff) |
Add support for backward compatibility workarounds during package manifest serialization
Diffstat (limited to 'libbpkg/manifest.hxx')
-rw-r--r-- | libbpkg/manifest.hxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 77043b0..4aa9b73 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -883,8 +883,19 @@ namespace bpkg validate_overrides (const std::vector<butl::manifest_name_value>&, const std::string& source_name); + // If the minimum libbpkg version is specified, then also apply the + // required backward compatibility workarounds to the serialized manifest + // so that clients of all libbpkg versions greater or equal to the + // specified version can parse it, ignoring unknown values. + // + // Note that clients of the latest major libbpkg version can fully + // recognize the produced manifest and thus can parse it without ignoring + // unknown values. + // void - serialize (butl::manifest_serializer&) const; + serialize ( + butl::manifest_serializer&, + const butl::optional<butl::standard_version>& = butl::nullopt) const; // Serialize only package manifest header values. // @@ -946,10 +957,12 @@ namespace bpkg // Serialize. // inline void - pkg_package_manifest (butl::manifest_serializer& s, - const package_manifest& m) + pkg_package_manifest ( + butl::manifest_serializer& s, + const package_manifest& m, + const butl::optional<butl::standard_version>& min_ver = butl::nullopt) { - m.serialize (s); + m.serialize (s, min_ver); } // Normally there is no need to serialize dir and git package manifests, @@ -978,8 +991,14 @@ namespace bpkg pkg_package_manifests (butl::manifest_parser&, bool ignore_unknown = false); + // If the minimum libbpkg version is specified, then also apply the + // required backward compatibility workarounds to the serialized package + // manifests list (see package_manifest::serialize() for details). + // void - serialize (butl::manifest_serializer&) const; + serialize ( + butl::manifest_serializer&, + const butl::optional<butl::standard_version>& = butl::nullopt) const; }; class LIBBPKG_EXPORT dir_package_manifests: |