diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-03 00:03:25 -0500 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-03 00:03:25 -0500 |
| commit | d7434129524162f356c3cd154f46a395c9076df7 (patch) | |
| tree | bb373ee409966552d8bb68a2ff53ee1d198feeb3 /scripts | |
| parent | 8fbc17f8db752a403f262ee28c93d47fb57ed334 (diff) | |
| download | meta-virtualization-d7434129524162f356c3cd154f46a395c9076df7.tar.gz | |
oe-go-mod-fetcher-hybrid: improve duplicate detection
The main go-mod discovery fetcher had stronger duplicate detection
than the hybrid mode converter. We synchronize the two to avoid
getting dups in our generate SRC_URIs.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/oe-go-mod-fetcher-hybrid.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/oe-go-mod-fetcher-hybrid.py b/scripts/oe-go-mod-fetcher-hybrid.py index 46d86fc4..f5934ed2 100755 --- a/scripts/oe-go-mod-fetcher-hybrid.py +++ b/scripts/oe-go-mod-fetcher-hybrid.py | |||
| @@ -515,10 +515,14 @@ def generate_hybrid_files( | |||
| 515 | "" | 515 | "" |
| 516 | ] | 516 | ] |
| 517 | 517 | ||
| 518 | # Track added vcs_hashes to avoid duplicates when multiple modules | ||
| 519 | # share the same git repo/commit (e.g., errdefs and errdefs/pkg) | ||
| 520 | added_vcs_hashes = set() | ||
| 518 | for mod in sorted(git_modules, key=lambda m: m['module']): | 521 | for mod in sorted(git_modules, key=lambda m: m['module']): |
| 519 | vcs_hash = mod.get('vcs_hash', '') | 522 | vcs_hash = mod.get('vcs_hash', '') |
| 520 | if vcs_hash in vcs_info: | 523 | if vcs_hash in vcs_info and vcs_hash not in added_vcs_hashes: |
| 521 | git_lines.append(vcs_info[vcs_hash]['full_line']) | 524 | git_lines.append(vcs_info[vcs_hash]['full_line']) |
| 525 | added_vcs_hashes.add(vcs_hash) | ||
| 522 | 526 | ||
| 523 | git_file = output_dir / 'go-mod-hybrid-git.inc' | 527 | git_file = output_dir / 'go-mod-hybrid-git.inc' |
| 524 | git_file.write_text('\n'.join(git_lines) + '\n') | 528 | git_file.write_text('\n'.join(git_lines) + '\n') |
