[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:40:45 UTC 2024
@pmatilai commented on this pull request.
> @@ -0,0 +1,12 @@
+#!/usr/bin/python3
+
+# Query all packages that match part of their name with the searched string.
+# A Python equivalent for `rpm -qa kernel*`
+
+import rpm
+
+ts = rpm.TransactionSet()
+mi = ts.dbMatch()
+mi.pattern("name", rpm.RPMMIRE_GLOB, "kernel*")
I would make the package name in these examples something you pass on the command line to make them actually usable on real systems which are unlikely to have "hello" package installed.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3177#pullrequestreview-2135230491
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3177/review/2135230491 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240624/ea6ace9b/attachment-0001.html>
More information about the Rpm-maint
mailing list