From 581de7e14caeb79104702db4ce30d190b629059c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 24 Apr 2017 19:08:29 +0300 Subject: Add build-email value to package details page --- mod/mod-package-version-details.cxx | 9 +++++++-- tests/load/1/math/libexp-1~1.2+1.tar.gz | Bin 302 -> 315 bytes tests/load/1/math/packages | 3 ++- tests/load/driver.cxx | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index b0e6ead..d2bcf5b 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -160,6 +160,7 @@ handle (request& rq, response& rs) assert (pkg->location && pkg->sha256sum); + const email& em (pkg->email); const repository_location& rl (pkg->internal_repository.load ()->location); s << TABLE(CLASS="proplist", ID="version") @@ -181,16 +182,20 @@ handle (request& rq, response& rs) << TABLE(CLASS="proplist", ID="package") << TBODY << TR_URL (pkg->url) - << TR_EMAIL (pkg->email); + << TR_EMAIL (em); const auto& pu (pkg->package_url); if (pu && *pu != pkg->url) s << TR_URL (*pu, "pkg-url"); const auto& pe (pkg->package_email); - if (pe && *pe != pkg->email) + if (pe && *pe != em) s << TR_EMAIL (*pe, "pkg-email"); + const auto& be (pkg->build_email); + if (be && ((pe && *be != *pe) || (!pe && *be != em))) + s << TR_EMAIL (*be, "build-email"); + s << TR_TAGS (pkg->tags, root) << ~TBODY << ~TABLE; diff --git a/tests/load/1/math/libexp-1~1.2+1.tar.gz b/tests/load/1/math/libexp-1~1.2+1.tar.gz index 937a084..1e1807f 100644 Binary files a/tests/load/1/math/libexp-1~1.2+1.tar.gz and b/tests/load/1/math/libexp-1~1.2+1.tar.gz differ diff --git a/tests/load/1/math/packages b/tests/load/1/math/packages index 9e1c30f..22a3167 100644 --- a/tests/load/1/math/packages +++ b/tests/load/1/math/packages @@ -9,10 +9,11 @@ tags: c++, exponent description: The exponent math function. url: http://www.exp.com email: users@exp.com +build-email: builds@exp.com depends: libmisc depends: libpq >= 9.0.0 location: libexp-1~1.2+1.tar.gz -sha256sum: 49172533e10e1dd9b8f80bcd25d25397f143ba49a944cd8cb8fd273823b7c10e +sha256sum: 96add9edada45f4ceee18b3ec344ca3c4fc1473d9aad22a13e97d7728a439087 : name: libfoo version: 1.0 diff --git a/tests/load/driver.cxx b/tests/load/driver.cxx index f2c97b5..24b29b4 100644 --- a/tests/load/driver.cxx +++ b/tests/load/driver.cxx @@ -611,6 +611,7 @@ main (int argc, char* argv[]) assert (!epv->package_url); assert (epv->email == email ("users@exp.com")); assert (!epv->package_email); + assert (epv->build_email && *epv->build_email == "builds@exp.com"); assert (epv->internal_repository.load () == mr); assert (epv->other_repositories.empty ()); @@ -636,7 +637,7 @@ main (int argc, char* argv[]) assert (check_location (epv)); assert (epv->sha256sum && *epv->sha256sum == - "49172533e10e1dd9b8f80bcd25d25397f143ba49a944cd8cb8fd273823b7c10e"); + "96add9edada45f4ceee18b3ec344ca3c4fc1473d9aad22a13e97d7728a439087"); // Verify libpq package version. // -- cgit v1.1