This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit 0711456224594e68b7934209c6b3010ce8f85b24
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 21 09:34:48 2026 +0200

    newt/pkg: Check errors from optional check script and link tables
    
    resolvePathSetting() returns no error when a setting is not present,
    so the only errors left for bsp.optionalcheckscript are an invalid
    path or an unknown repository. Those were silently ignored and the
    check script was not run. Report them like for the other BSP scripts.
    
    Also check the error returned by readLinkTables(). It currently never
    fails, but the result was assigned and then overwritten by the next
    call.
    
    Assisted-by: Claude:claude-opus-5-5
---
 newt/pkg/bsp_package.go  | 3 +++
 newt/pkg/localpackage.go | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/newt/pkg/bsp_package.go b/newt/pkg/bsp_package.go
index 6807d2b1..1d8f69bf 100644
--- a/newt/pkg/bsp_package.go
+++ b/newt/pkg/bsp_package.go
@@ -226,6 +226,9 @@ func (bsp *BspPackage) Reload(settings *cfgv.Settings) 
error {
        /* Optional Target Checker Script, not an err if not found */
        bsp.OptChkScript, err = bsp.resolvePathSetting(
                settings, "bsp.optionalcheckscript")
+       if err != nil {
+               return err
+       }
 
        if bsp.CompilerName == "" {
                return util.NewNewtError("BSP does not specify a compiler " +
diff --git a/newt/pkg/localpackage.go b/newt/pkg/localpackage.go
index 44d3208b..cd32a74b 100644
--- a/newt/pkg/localpackage.go
+++ b/newt/pkg/localpackage.go
@@ -377,6 +377,9 @@ func (pkg *LocalPackage) Load() error {
        }
 
        pkg.linkTables, err = pkg.readLinkTables(pkg.PkgY)
+       if err != nil {
+               return err
+       }
 
        // Load syscfg settings.
        pkg.SyscfgY, err = config.ReadFile(pkg.SyscfgYamlPath())

Reply via email to