I looked at python-apt
and python-debian
, and they don\'t seem to have functionality to compare package versions. Do I have to write my own, or is
python-debian
can do this too. It's used in an almost identical way to python-apt
:
from debian import debian_support
a = '1:1.3.10-0.3'
b = '1.3.4-1'
vc = debian_support.version_compare(a,b)
if vc > 0:
print('version a > version b')
elif vc == 0:
print('version a == version b')
elif vc < 0:
print('version a < version b')
ouput:
version a > version b