aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-12-17 18:48:10 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-01-08 16:26:51 +0300
commitd51aa769a5441ccb5279e2fc4f50b127db0dea84 (patch)
tree815764db8338b694a9dd9e7a5a33e4297863fa5c
parent5497c2c090bb40de18e6169da94655bd67c64944 (diff)
Make use of package_manifest::load_files() function
-rw-r--r--bpkg/pkg-verify.cxx35
1 files changed, 6 insertions, 29 deletions
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;