mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 11:34:13 +00:00
chromium: Fix the version comparison in print_updates()
I forgot that string comparison isn't enough because e.g.: >>> "89.0.4389.9" < "89.0.4389.23" False distutils.version.LooseVersion is undocumented but it works and is already available so why not use it: >>> LooseVersion("89.0.4389.9") < LooseVersion("89.0.4389.23") True
This commit is contained in:
parent
ff937db1f6
commit
863982d272
@ -13,6 +13,7 @@ import sys
|
||||
from codecs import iterdecode
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
from distutils.version import LooseVersion
|
||||
from os.path import abspath, dirname
|
||||
from urllib.request import urlopen
|
||||
|
||||
@ -122,7 +123,7 @@ def print_updates(channels_old, channels_new):
|
||||
for channel_name in channels_old:
|
||||
version_old = channels_old[channel_name]["version"]
|
||||
version_new = channels_new[channel_name]["version"]
|
||||
if version_old < version_new:
|
||||
if LooseVersion(version_old) < LooseVersion(version_new):
|
||||
attr_name = channel_name_to_attr_name(channel_name)
|
||||
print(f'- {attr_name}: {version_old} -> {version_new}')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user