diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-31 16:46:44 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-31 16:53:40 +0300 |
commit | 566ac9e3dfb5d05ab83f81f81adf3810a8f69ebe (patch) | |
tree | 9e5f027f8d2ae34fa16b090a810bc47fcdafe094 /bpkg | |
parent | 1abaeaf0ab3e732c9fb0b83510575e7a90bd1c68 (diff) |
Fix signature_manifest ctor to check for end of stream
Diffstat (limited to 'bpkg')
-rw-r--r-- | bpkg/manifest | 2 | ||||
-rw-r--r-- | bpkg/manifest.cxx | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/bpkg/manifest b/bpkg/manifest index 19dd960..8ad9512 100644 --- a/bpkg/manifest +++ b/bpkg/manifest @@ -23,6 +23,8 @@ namespace bpkg { using strings = std::vector<std::string>; + // @@ Let's create <bpkg/types> with "basic" package types. + // class LIBBPKG_EXPORT version { public: diff --git a/bpkg/manifest.cxx b/bpkg/manifest.cxx index 54627e7..107c2fe 100644 --- a/bpkg/manifest.cxx +++ b/bpkg/manifest.cxx @@ -705,7 +705,7 @@ namespace bpkg // used for version constrains rather than actual releases. // if (version.release && version.release->empty ()) - bad_name ("invalid package version release"); + bad_value ("invalid package version release"); } else if (n == "summary") { @@ -1242,8 +1242,6 @@ namespace bpkg s.next ("package-email", add_comment (*package_email, package_email->comment)); - - for (const auto& d: dependencies) s.next ("depends", (d.conditional @@ -2155,6 +2153,13 @@ namespace bpkg bad_value ("no sha256sum specified"); else if (signature.empty ()) bad_value ("no signature specified"); + + // Make sure this is the end. + // + nv = p.next (); + if (!nv.empty ()) + throw parsing (p.name (), nv.name_line, nv.name_column, + "single signature manifest expected"); } void signature_manifest:: |