diff --git a/src/pkgcheck/results.py b/src/pkgcheck/results.py index 23d639fcc..be732d449 100644 --- a/src/pkgcheck/results.py +++ b/src/pkgcheck/results.py @@ -225,6 +225,21 @@ def __init__(self, pkg, **kwargs): self.version = pkg.fullver self._attr = "version" + if hasattr(pkg, "lines"): + lines = pkg.lines + elif ebuild := getattr(pkg, "ebuild", None): + with ebuild.text_fileobj() as fileobj: + lines = tuple(fileobj) + else: + lines = () + + for line in map(str.rstrip, lines): + if line and not line.startswith("#"): + break # stop after first non-comment non-empty line + elif line == f"# pkgcheck skip: {self.__class__.__name__}": + self._filtered = True + break + @klass.jit_attr def ver_rev(self): version, _, revision = self.version.partition("-r")