[Tutor] How to Compare rpm version using Python Script
David Rock
david at graniteweb.com
Fri Nov 29 19:16:32 EST 2019
* Mats Wichmann <mats at wichmann.us> [2019-11-29 07:20]:
>
> Will say that a challenge is going to be to distinguish the package names
> from the versions when you're reading from a file. For the installed
> packages this is easy, rpm already knows how to do that, and it's not a
> Python problem at all - your example above already shows how, you just put a
> separator between the pieces you want to look like different words, for
> example '%{name} %{version}'.
To reinforce this idea... do NOT use hyphens in your rpm -q command; use
spaces instead. It will make it a LOT easier to separate the name from the
version (many names contain hyphens) to compare against the lists.
--
David Rock
david at graniteweb.com
More information about the Tutor
mailing list