Comparing text strings

Grant Edwards grant.b.edwards at gmail.com
Mon Apr 12 21:15:03 EDT 2021


On 2021-04-12, 2QdxY4RzWzUUiLuE at potatochowder.com <2QdxY4RzWzUUiLuE at potatochowder.com> wrote:

> I don't know whether or how Slackware handles "compound" package names
> (e.g., python-flask), but at some point, you're going to have to pull
> apart (aka---gasp--parse), the package names to come up with the name
> itself and the version (and the architecture, etc.), compare the name
> parts to find the "duplicates," and then compare the versions (and maybe
> the build number) to eliminate the lesser ones.
>
> You'll also have to watch for the transitions from, say, 0.9 to 0.10, or
> from 1.0rc2 to 1.0, which may not sort simply.

Indeed. Sorting version numbers is very dark magic, and you'll need to
know way more than you want to about the version numbering conventions
in your distro. There may be all sorts of exceptions and special cases
(like handling an rcNN version-number suffix as mentioned above).

--
Grant





More information about the Python-list mailing list