From d51aa769a5441ccb5279e2fc4f50b127db0dea84 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 17 Dec 2018 18:48:10 +0300 Subject: Make use of package_manifest::load_files() function --- bpkg/pkg-verify.cxx | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'bpkg/pkg-verify.cxx') diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx index c55fba9..d14f606 100644 --- a/bpkg/pkg-verify.cxx +++ b/bpkg/pkg-verify.cxx @@ -70,46 +70,23 @@ namespace bpkg // if (ev) { - // Expand the description-file manifest value. - // - if (m.description && m.description->file) - { - path f (pd / m.description->path); - string s (extract (co, af, f, diag)); - - if (s.empty ()) + m.load_files ( + [&pd, &co, &af, diag] (const string& n, const path& p) { - if (diag) - error << "description-file manifest value in package archive " - << af << " references empty file " << f; - - throw failed (); - } - - m.description = text_file (move (s)); - } - - // Expand the changes-file manifest values. - // - for (auto& c: m.changes) - { - if (c.file) - { - path f (pd / c.path); + path f (pd / p); string s (extract (co, af, f, diag)); if (s.empty ()) { if (diag) - error << "changes-file manifest value in package archive " + error << n << " manifest value in package archive " << af << " references empty file " << f; throw failed (); } - c = text_file (move (s)); - } - } + return s; + }); } return m; -- cgit v1.1