From d7434129524162f356c3cd154f46a395c9076df7 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Sat, 3 Jan 2026 00:03:25 -0500 Subject: [PATCH] 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 --- scripts/oe-go-mod-fetcher-hybrid.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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( "" ] + # Track added vcs_hashes to avoid duplicates when multiple modules + # share the same git repo/commit (e.g., errdefs and errdefs/pkg) + added_vcs_hashes = set() for mod in sorted(git_modules, key=lambda m: m['module']): vcs_hash = mod.get('vcs_hash', '') - if vcs_hash in vcs_info: + if vcs_hash in vcs_info and vcs_hash not in added_vcs_hashes: git_lines.append(vcs_info[vcs_hash]['full_line']) + added_vcs_hashes.add(vcs_hash) git_file = output_dir / 'go-mod-hybrid-git.inc' git_file.write_text('\n'.join(git_lines) + '\n')