aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-03-11 18:45:17 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-03-11 18:45:17 +0300
commit218cd07992a715246076128ebf7ff67275f4dce0 (patch)
tree54c0ca75c73e6f61fd3f4ea5744715ee91f54f64
parented0dd177c63bb7758e8633ffe26de2a8bc315d1b (diff)
Adapt to manifest classes refactoring
-rw-r--r--load/load.cxx26
-rw-r--r--tests/load/1/math/packages2
-rw-r--r--tests/load/driver.cxx2
3 files changed, 11 insertions, 19 deletions
diff --git a/load/load.cxx b/load/load.cxx
index 7556449..7786e0e 100644
--- a/load/load.cxx
+++ b/load/load.cxx
@@ -292,29 +292,23 @@ load_packages (const shared_ptr<repository>& rp, database& db)
optional<string> dsc;
if (pm.description)
{
- if (pm.description->file)
- {
- // @@ Pull description from the file when package manager API
- // is ready.
- }
- else
- dsc = move (*pm.description);
+ assert (!pm.description->file);
+ dsc = move (pm.description->text);
}
string chn;
for (auto& c: pm.changes)
{
- if (c.file)
- {
- // @@ Pull change notes from the file when package manager
- // API is ready.
- }
+ assert (!c.file);
+
+ if (chn.empty ())
+ chn = move (c.text);
else
{
- if (chn.empty ())
- chn = move (c);
- else
- chn += "\n" + c;
+ if (chn.back () != '\n')
+ chn += '\n'; // Always have a blank line as a separator.
+
+ chn += "\n" + c.text;
}
}
diff --git a/tests/load/1/math/packages b/tests/load/1/math/packages
index 115e3f1..e8d4410 100644
--- a/tests/load/1/math/packages
+++ b/tests/load/1/math/packages
@@ -6,8 +6,6 @@ version: 1.0.0+1
summary: Modern C++ XML API
license: MIT
tags: c++, xml, parser, serializer, pull, streaming, modern
-description-file: README
-changes-file: NEWS
url: http://www.codesynthesis.com/projects/libstudxml/
email: studxml-users@codesynthesis.com; Public mailing list, posts by\
non-members are allowed but moderated.
diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx
index a9b9823..bb46033 100644
--- a/tests/load/driver.cxx
+++ b/tests/load/driver.cxx
@@ -337,7 +337,7 @@ main (int argc, char* argv[])
assert (fpv4->internal_repository.load () == sr);
assert (fpv4->other_repositories.empty ());
assert (fpv4->priority == priority::low);
- assert (fpv4->changes == "some changes 1\nsome changes 2");
+ assert (fpv4->changes == "some changes 1\n\nsome changes 2");
assert (fpv4->license_alternatives.size () == 1);
assert (fpv4->license_alternatives[0].comment ==