diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-06-12 13:57:31 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-06-12 14:00:28 +0300 |
commit | 20a456e33222ed31008db3c328f1e10c212acf00 (patch) | |
tree | 49656edebb9e6ad6bb139d46d52a8c45c6e2af65 /mod/mod-package-version-details.cxx | |
parent | a259cbd13dcf9a25fdd758fc18f7611e1ac404f6 (diff) |
Make project url and email optional in package manifest
Diffstat (limited to 'mod/mod-package-version-details.cxx')
-rw-r--r-- | mod/mod-package-version-details.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index 2134cc6..cef9357 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -205,8 +205,12 @@ handle (request& rq, response& rs) << ~TABLE << TABLE(CLASS="proplist", ID="package") - << TBODY - << TR_URL (pkg->url); + << TBODY; + + const auto& u (pkg->url); + + if (u) + s << TR_URL (*u); if (pkg->doc_url) s << TR_URL (*pkg->doc_url, "doc-url"); @@ -215,18 +219,20 @@ handle (request& rq, response& rs) s << TR_URL (*pkg->src_url, "src-url"); const auto& pu (pkg->package_url); - if (pu && *pu != pkg->url) + if (pu && pu != u) s << TR_URL (*pu, "package-url"); - const email& em (pkg->email); - s << TR_EMAIL (em); + const auto& em (pkg->email); + + if (em) + s << TR_EMAIL (*em); const auto& pe (pkg->package_email); - if (pe && *pe != em) + if (pe && pe != em) s << TR_EMAIL (*pe, "package-email"); const auto& be (pkg->build_email); - if (be && ((pe && *be != *pe) || (!pe && *be != em))) + if (be && ((pe && be != pe) || (!pe && be != em))) s << TR_EMAIL (*be, "build-email"); s << TR_TAGS (pkg->tags, root) |