Hello everyone!
I’m working on a pull request for the slackpkg module, and I found myself needing to compare version strings. I used packaging.version.parse() for this purpose, thinking that this wouldn’t be a problem since it’s a dependency of setuptools, and that’s installed anyway since ansible needs it.
But of course then I found out that module code is executed on the remote server, and that does not necessarily have setuptools installed. This is really bad, because you can’t even install setuptools via ansible.slackpkg this way.
What would you advise? Should I include the ±300 relevant rules of code from packaging? Should I find a different way of comparing version strings? Does ansible maybe offer a utility for this?
Extra information:
I need to compare version strings because slackpkg upgrade does not do so, resulting in downgraded packages if the installed version is newer than the one found in the repository (this happens fairly often in slackware because of the popularity of slackbuilds).
Thanks for your input in advance, and keep up the good work. I love this project!
Kind regards,
Tamara aka nihlaeth