diff --git a/whipper/program/cdparanoia.py b/whipper/program/cdparanoia.py index 5c4b7793..9024c91e 100644 --- a/whipper/program/cdparanoia.py +++ b/whipper/program/cdparanoia.py @@ -27,6 +27,8 @@ import tempfile import time +from packaging.version import Version + from whipper.common import common from whipper.common import task as ctask from whipper.extern import asyncsub @@ -284,16 +286,20 @@ def start(self, runner): self.path]) logger.debug('running %s', (" ".join(argv), )) if self._offset > 587: - logger.warning( - "because of a cd-paranoia upstream bug whipper may fail to " - "work correctly when using offset values > 587 (current " - "value: %d) and print warnings like this: 'file size 0 did " - "not match expected size'. For more details please check the " - "following issues: " - "https://github.com/whipper-team/whipper/issues/234 and " - "https://github.com/rocky/libcdio-paranoia/issues/14", - self._offset - ) + if Version(_CDPARANOIA_VERSION) <= Version('10.2'): + # the bug was fixed in cd-paranoia 10.2+2.0.2 + # but all cd-paranoia 10.2 releases have the same version number, + # so we match up to 10.2 + logger.warning( + "because of a cd-paranoia upstream bug whipper may fail to " + "work correctly when using offset values > 587 (current " + "value: %d) and print warnings like this: 'file size 0 did " + "not match expected size'. For more details please check the " + "following issues: " + "https://github.com/whipper-team/whipper/issues/234 and " + "https://github.com/rocky/libcdio-paranoia/issues/14", + self._offset + ) if stopTrack == 99: logger.warning( "because of a cd-paranoia upstream bug whipper may fail to " @@ -580,6 +586,12 @@ def getCdParanoiaVersion(): return getter.get() +try: + _CDPARANOIA_VERSION = getCdParanoiaVersion().split(' ')[1] +except IndexError: + _CDPARANOIA_VERSION = '0' + + _OK_RE = re.compile(r'Drive tests OK with Paranoia.') _WARNING_RE = re.compile(r'WARNING! PARANOIA MAY NOT BE') _ABORTING_RE = re.compile(r'aborting test\.')