diff options
| author | Brian Dolbec <dolsen@gentoo.org> | 2022-07-09 20:41:54 -0700 |
|---|---|---|
| committer | Brian Dolbec <dolsen@gentoo.org> | 2022-07-09 20:44:38 -0700 |
| commit | cc0b45fde4d333bd62da9988bc35418cd383c9ee (patch) | |
| tree | 41fe35717987ee8c10e762205f61e72e82e3ca67 | |
| parent | 8c9b533343801fcab49a150c1e49dddf7bdaf4f3 (diff) | |
| download | gentoolkit-cc0b45fde4d333bd62da9988bc35418cd383c9ee.tar.gz | |
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 <dolsen@gentoo.org>
| -rw-r--r-- | pym/gentoolkit/equery/meta.py | 2 | ||||
| -rw-r--r-- | pym/gentoolkit/package.py | 9 |
2 files changed, 11 insertions, 0 deletions
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 |
