diff options
| -rw-r--r-- | meta/classes-global/insane.bbclass | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index f7a2c392cf..6f3cd3026d 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass | |||
| @@ -1353,16 +1353,22 @@ python do_qa_patch() { | |||
| 1353 | ########################################################################### | 1353 | ########################################################################### |
| 1354 | def match_line_in_files(toplevel, filename_glob, line_regex): | 1354 | def match_line_in_files(toplevel, filename_glob, line_regex): |
| 1355 | import pathlib | 1355 | import pathlib |
| 1356 | toppath = pathlib.Path(toplevel) | 1356 | try: |
| 1357 | for entry in toppath.glob(filename_glob): | 1357 | toppath = pathlib.Path(toplevel) |
| 1358 | try: | 1358 | for entry in toppath.glob(filename_glob): |
| 1359 | with open(entry, 'r', encoding='utf-8', errors='ignore') as f: | 1359 | try: |
| 1360 | for line in f.readlines(): | 1360 | with open(entry, 'r', encoding='utf-8', errors='ignore') as f: |
| 1361 | if re.match(line_regex, line): | 1361 | for line in f.readlines(): |
| 1362 | return True | 1362 | if re.match(line_regex, line): |
| 1363 | except FileNotFoundError: | 1363 | return True |
| 1364 | # Broken symlink in source | 1364 | except FileNotFoundError: |
| 1365 | pass | 1365 | # Broken symlink in source |
| 1366 | pass | ||
| 1367 | except FileNotFoundError: | ||
| 1368 | # pathlib.Path.glob() might throw this when file/directory | ||
| 1369 | # disappear while scanning. | ||
| 1370 | bb.note("unimplemented-ptest: FileNotFoundError exception while scanning (disappearing file while scanning?). Check was ignored." % d.getVar('PN')) | ||
| 1371 | pass | ||
| 1366 | return False | 1372 | return False |
| 1367 | 1373 | ||
| 1368 | srcdir = d.getVar('S') | 1374 | srcdir = d.getVar('S') |
