public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/, pym/gentoolkit/
Date: Sun, 10 Jul 2022 03:47:17 +0000 (UTC)	[thread overview]
Message-ID: <1657424678.cc0b45fde4d333bd62da9988bc35418cd383c9ee.dolsen@gentoo> (raw)

commit:     cc0b45fde4d333bd62da9988bc35418cd383c9ee
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 03:41:54 2022 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 03:44:38 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=cc0b45fd

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 <AT> gentoo.org>

 pym/gentoolkit/equery/meta.py | 2 ++
 pym/gentoolkit/package.py     | 9 +++++++++
 2 files changed, 11 insertions(+)

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


             reply	other threads:[~2022-07-10  3:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10  3:47 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-09  2:41 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/, pym/gentoolkit/ Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1657424678.cc0b45fde4d333bd62da9988bc35418cd383c9ee.dolsen@gentoo \
    --to=dolsen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox