From: John Ripple <john.ripple@keysight.com>
To: openembedded-core@lists.openembedded.org
Cc: John Ripple <john.ripple@keysight.com>
Subject: [meta][PATCH v2 1/3] go-vendor.bbclass: Fix test file exclusion and license propagation
Date: Wed, 15 Jul 2026 09:20:07 -0600 [thread overview]
Message-ID: <20260715152011.3542412-2-john.ripple@keysight.com> (raw)
In-Reply-To: <20260715152011.3542412-1-john.ripple@keysight.com>
Two bugs in do_go_vendor:
1. The shutil.ignore_patterns glob was "*._test.go" (with an extra dot),
which never matches standard Go test files (*_test.go). Remove the
extra dot.
2. The license-propagation block used os.path.join(src, "LICENSE") as the
copy destination, writing into the already-processed vendor.fetch source
tree rather than into the vendor destination directory. Switch to
os.path.join(dst, "LICENSE") so the LICENSE lands in vendor/ where go
tools and licence scanners expect it. Also fix the guard condition from
not os.path.exists(subdir) (checking an unrelated relative name) to
not os.path.exists(subdirLicense) (checking the actual target).
Signed-off-by: John Ripple <john.ripple@keysight.com>
---
meta/classes/go-vendor.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/go-vendor.bbclass b/meta/classes/go-vendor.bbclass
index e879d629a8..85a3c1b586 100644
--- a/meta/classes/go-vendor.bbclass
+++ b/meta/classes/go-vendor.bbclass
@@ -141,7 +141,7 @@ python do_go_vendor() {
shutil.copytree(src, dst, symlinks=True, dirs_exist_ok=True, \
ignore=shutil.ignore_patterns(".git", \
"vendor", \
- "*._test.go"))
+ "*_test.go"))
# If the root directory has a LICENSE file but not the subdir
# we copy the root license to the sub module since the license
@@ -149,9 +149,9 @@ python do_go_vendor() {
# see https://go.dev/ref/mod#vcs-license
if subdir:
rootdirLicese = os.path.join(rootdir, "LICENSE")
- subdirLicense = os.path.join(src, "LICENSE")
+ subdirLicense = os.path.join(dst, "LICENSE")
- if not os.path.exists(subdir) and \
+ if not os.path.exists(subdirLicense) and \
os.path.exists(rootdirLicese):
shutil.copy2(rootdirLicese, subdirLicense)
next prev parent reply other threads:[~2026-07-15 15:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 15:20 [PATCH v2 0/3] Create selftest suite for go-vendor.bbclass John Ripple
2026-07-15 15:20 ` John Ripple [this message]
2026-07-15 15:20 ` [meta][meta-selftest][PATCH v2 2/3] oeqa/selftest: Add go-vendor.bbclass selftest suite John Ripple
2026-07-16 14:08 ` [OE-core] " Mathieu Dubois-Briand
2026-07-15 15:20 ` [meta][PATCH v2 3/3] go-vendor.bbclass: Run vendor_unlink task under fakeroot John Ripple
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715152011.3542412-2-john.ripple@keysight.com \
--to=john.ripple@keysight.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox