Skip to content

Commit

Permalink
GitPkgCommitsCheck: fix failure during compute of environment
Browse files Browse the repository at this point in the history
In rare cases, ebd might fail for some ebuilds during the compute of
`.environment` property. For now let's eat up all of those cases since
other checks will catch the issues.

Signed-off-by: Arthur Zamarin <[email protected]>
  • Loading branch information
arthurzam committed Jul 15, 2023
1 parent 59cfd9b commit 5688029
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/pkgcheck/checks/git.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Various git-related checks."""

import contextlib
import os
import re
import subprocess
Expand Down Expand Up @@ -440,13 +441,14 @@ def found_pep517_lines(cmp_pkg):
else:
yield MissingSlotmove(old_slot, new_slot, pkg=new_pkg)

for env_line in new_pkg.environment.data.splitlines():
if mo := self.python_compat_declare_regex.match(env_line):
if old_compat := {
m.group("val")
for m in re.finditer(self.env_array_elem_regex, mo.group("value"))
}.difference(self.valid_python_targets):
yield OldPythonCompat(sorted(old_compat), pkg=new_pkg)
with contextlib.suppress(Exception):
for env_line in new_pkg.environment.data.splitlines():
if mo := self.python_compat_declare_regex.match(env_line):
if old_compat := {
m.group("val")
for m in re.finditer(self.env_array_elem_regex, mo.group("value"))
}.difference(self.valid_python_targets):
yield OldPythonCompat(sorted(old_compat), pkg=new_pkg)

def _fetchable_str(self, fetch: fetchable) -> tuple[str, str]:
uri = tuple(fetch.uri._uri_source)[0]
Expand Down

0 comments on commit 5688029

Please sign in to comment.