[Rpm-maint] [rpm-software-management/rpm] Add real-life examples of Python RPM (PR #3177)
Panu Matilainen
notifications at github.com
Mon Jun 24 09:38:49 UTC 2024
@pmatilai commented on this pull request.
> @@ -0,0 +1,34 @@
+#!/usr/bin/python3
+
+# Query a single package but this time print more information.
+# A Python equivalent for `rpm -qi hello`
+
+import rpm
+
+name = "hello"
+ts = rpm.TransactionSet()
+mi = ts.dbMatch("name", name)
+hdr = next(mi, None)
+if hdr:
This should be a loop to handle multiple identically named packages.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3177#pullrequestreview-2135220208
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3177/review/2135220208 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240624/0734149f/attachment.html>
More information about the Rpm-maint
mailing list