Skip to content

Commit

Permalink
Add support for CoMaintainers field in info responses
Browse files Browse the repository at this point in the history
  • Loading branch information
falconindy committed Aug 18, 2024
1 parent c694607 commit 3889e6f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions man/auracle.1.pod
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ day in dotted form.

String array fields: B<{depends}>, B<{makedepends}>, B<{checkdepends}>,
B<{optdepends}>, B<{conflicts}>, B<{provides}>, B<{replaces}>, B<{groups}>,
B<{keywords}>, B<{licenses}>. These fields default to using a delimiter of two
whitespace, but can be customized, e.g. B<{depends:,}> to comma delimit the
values of the depends field.
B<{keywords}>, B<{licenses}>, B<{comaintainers}>. These fields default to using
a delimiter of two whitespace, but can be customized, e.g. B<{depends:,}> to
comma delimit the values of the depends field.

Example: recreating auracle's search output:

Expand Down
1 change: 1 addition & 0 deletions src/aur/package.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void from_json(const nlohmann::json& j, Package& p) {
// clang-format off
static const auto& callbacks = *new CallbackMap<Package>{
{ "CheckDepends", MakeValueCallback(&Package::checkdepends) },
{ "CoMaintainers", MakeValueCallback(&Package::comaintainers) },
{ "Conflicts", MakeValueCallback(&Package::conflicts) },
{ "Depends", MakeValueCallback(&Package::depends) },
{ "Description", MakeValueCallback(&Package::description) },
Expand Down
1 change: 1 addition & 0 deletions src/aur/package.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct Package {
std::vector<std::string> optdepends;
std::vector<std::string> provides;
std::vector<std::string> replaces;
std::vector<std::string> comaintainers;

std::vector<Dependency> depends;
std::vector<Dependency> makedepends;
Expand Down
2 changes: 2 additions & 0 deletions src/auracle/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ void Long(const aur::Package& package,
fmt::print("{}", Field("Popularity", p.popularity));
fmt::print("{}", Field("Maintainer",
p.maintainer.empty() ? "(orphan)" : p.maintainer));
fmt::print("{}", Field("Co-maintainers", p.comaintainers));
fmt::print("{}", Field("Submitted", p.submitted));
fmt::print("{}", Field("Last Modified", p.modified));
if (p.out_of_date > absl::UnixEpoch()) {
Expand All @@ -214,6 +215,7 @@ void FormatCustomTo(std::string& out, std::string_view format,
fmt::arg("name", package.name),
fmt::arg("description", package.description),
fmt::arg("maintainer", package.maintainer),
fmt::arg("comaintainers", package.comaintainers),
fmt::arg("version", package.version),
fmt::arg("pkgbase", package.pkgbase),
fmt::arg("url", package.upstream_url),
Expand Down

0 comments on commit 3889e6f

Please sign in to comment.