diff --git a/scripts/eddn-report-log-errors b/scripts/eddn-report-log-errors index 73307fe..ffa1c83 100755 --- a/scripts/eddn-report-log-errors +++ b/scripts/eddn-report-log-errors @@ -5,6 +5,8 @@ import argparse import re +import semantic_version + def parse_cl_args() -> str: """ @@ -59,13 +61,14 @@ def process_file(input_file: str) -> None: # print(matches.group('sender_ip')) # print('') + software_version = semantic_version.Version.coerce(matches.group('software_version')) ################################################################### # Issues we know about and HAVE already alerted their # developers to. ################################################################### if matches.group('software_name') == 'EDDiscovery': # https://github.com/EDDiscovery/EDDiscovery/releases/latest - if matches.group('software_version') == '12.1.7.0': + if software_version >= semantic_version.Version.coerce('12.1.7.0'): if matches.group('schema_ref') in ( 'https://eddn.edcd.io/schemas/shipyard/2', 'https://eddn.edcd.io/schemas/outfitting/2', @@ -79,7 +82,7 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'EDDLite': # https://github.com/EDDiscovery/EDDLite/releases/tag/latest - if matches.group('software_version') == '2.0.0': + if software_version >= semantic_version.Version.coerce('2.0.0'): if matches.group('schema_ref') in ( 'https://eddn.edcd.io/schemas/shipyard/2', 'https://eddn.edcd.io/schemas/outfitting/2', @@ -93,12 +96,12 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'EDDI': # https://github.com/EDCD/EDDI/releases/latest - if matches.group('software_version') == '4.0.1': + if software_version >= semantic_version.Version.coerce('4.0.1'): print(line) - elif matches.group('software_name') == 'E:D Market Connector [Windows]': + elif matches.group('software_name').startswith('E:D Market Connector'): # https://github.com/EDCD/EDMarketConnector/releases/latest - if matches.group('software_version') == '5.2.4': + if software_version >= semantic_version.Version.coerce('5.2.4'): if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/codexentry/1': # if matches.group('err_msg') != 'Failed Validation "[]"': @@ -117,6 +120,10 @@ def process_file(input_file: str) -> None: # pass + else: + print(matches.group('err_msg')) + print(line) + elif matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/fssdiscoveryscan/1': if matches.group('err_msg') == 'Failed Validation "[]"': # @@ -127,7 +134,7 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'Elite G19s Companion App': # - if matches.group('software_version') == '3.7.7888.21039': + if software_version >= semantic_version.Version.coerce('3.7.7888.21039'): if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/commodity/3': # Reported via Frontier forums: if matches.group('err_msg') != 'Failed Validation "[]"': @@ -139,7 +146,7 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'EDSM': # It's in-browser, no public source/releases - if matches.group('software_version') == '1.0.1': + if software_version >= semantic_version.Version.coerce('1.0.1'): if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/journal/1': if matches.group('journal_event') == 'Scan': # @@ -157,7 +164,7 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'EDSM - Console': # It's in-browser, no public source/releases - if matches.group('software_version') == '1.0': + if software_version >= semantic_version.Version.coerce('1.0'): if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/journal/1': if matches.group('journal_event') == 'Scan': # @@ -175,7 +182,7 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'EDAOS': # Apparently a Barry Carylon project, but no home page ? - if matches.group('software_version') == '1.2.3': + if software_version >= semantic_version.Version.coerce('1.2.3'): if matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/journal/1': if matches.group('journal_event') == 'Docked': # @@ -193,7 +200,7 @@ def process_file(input_file: str) -> None: elif matches.group('software_name') == 'EliteLogAgent': # - if matches.group('software_version') == '2.0.0.660': + if software_version >= semantic_version.Version.coerce('2.0.0.660'): print(line) # Abandoned/unmaintained project