[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to bet back to a sane version number?

* Hamish Moffatt:

> FWIW you can experiment quite easily using
> dpkg --compare-versions x lt y && echo Yes

> Interestingly, "4.22.." is considered higher than "4.22.3". I'm not sure
> if this is good advice though :-)

It's also a good idea to check against APT's implementation when
playing with strange version numbers (because it's not the same).  The
python-apt package contains a wrapper (not yet another independent

import apt_pkg
def compare(a, b):
  apt_pkg.VersionCompare(a, b)
# use compare as needed

Reply to: