From cc0b45fde4d333bd62da9988bc35418cd383c9ee Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 9 Jul 2022 20:41:54 -0700 Subject: equery meta: Fix missing description when not in metadata.xml Add description property to Package class. If no description in metadata.xml, get the description from the ebuild. Bug: https://bugs.gentoo.org/447538 Signed-off-by: Brian Dolbec --- pym/gentoolkit/equery/meta.py | 2 ++ pym/gentoolkit/package.py | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'pym') diff --git a/pym/gentoolkit/equery/meta.py b/pym/gentoolkit/equery/meta.py index 2e8dc36..124f59b 100644 --- a/pym/gentoolkit/equery/meta.py +++ b/pym/gentoolkit/equery/meta.py @@ -331,6 +331,8 @@ def call_format_functions(best_match, matches): if QUERY_OPTS["description"]: desc = best_match.metadata.descriptions() + if not desc: + desc = best_match.description print_sequence(format_list(desc)) if QUERY_OPTS["useflags"]: diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py index 92bc3a3..1110bf5 100644 --- a/pym/gentoolkit/package.py +++ b/pym/gentoolkit/package.py @@ -437,6 +437,15 @@ class Package(CPV): ) return self.cpv not in unmasked + @property + def description(self): + """Returns the DESCRIPTION from the ebuild + + @rtype: list + """ + + return portage.db[portage.root]["porttree"].dbapi.aux_get(self.cpv, ["DESCRIPTION"]) + class PackageFormatter: """When applied to a L{gentoolkit.package.Package} object, determine the -- cgit v1.2.3