aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-repository-details.cxx38
1 files changed, 30 insertions, 8 deletions
diff --git a/mod/mod-repository-details.cxx b/mod/mod-repository-details.cxx
index dffd0df..42e59cb 100644
--- a/mod/mod-repository-details.cxx
+++ b/mod/mod-repository-details.cxx
@@ -111,24 +111,21 @@ handle (request& rq, response& rs)
if (r.summary)
s << H2 << *r.summary << ~H2;
- if (r.description)
- s << P_DESCRIPTION (*r.description);
+ s << P
+ << A(HREF=r.location.string ()) << r.location << ~A << *BR;
if (r.email)
{
const email& e (*r.email);
- s << P
- << A(HREF="mailto:" + e) << e << ~A;
+ s << A(HREF="mailto:" + e) << e << ~A;
if (!e.comment.empty ())
s << " (" << e.comment << ")";
- s << ~P;
+ s << *BR;
}
- s << P << A(HREF=r.location.string ()) << r.location << ~A << ~P;
-
ostringstream o;
butl::to_stream (o,
max (r.packages_timestamp, r.repositories_timestamp),
@@ -136,7 +133,32 @@ handle (request& rq, response& rs)
true,
true);
- s << P << o.str () << ~P;
+ s << o.str ()
+ << ~P;
+
+ if (r.description)
+ s << P_DESCRIPTION (*r.description);
+
+ if (r.certificate)
+ {
+ const certificate& cert (*r.certificate);
+
+ size_t np (cert.name.find (':'));
+ assert (np != string::npos); // Naming scheme should always be present.
+
+ // Mimic the suggested format of the repository description so that the
+ // certificate info looks like just another section. Inside use the
+ // format similar to the bpkg rep-info output.
+ //
+ s << P << "REPOSITORY CERTIFICATE" << ~P
+ << P
+ << "CN=" << cert.name.c_str () + np + 1 << *BR
+ << "O=" << cert.organization << *BR
+ << email (cert.email)
+ << ~P
+ << P(CLASS="certfp") << cert.fingerprint << ~P
+ << PRE(CLASS="certpem") << cert.pem << ~PRE;
+ }
}
t.commit ();