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

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

commit 021b6156699f3ecbaa2af78236fed3fe5da01e36
Author: Andrzej Kaczmarek <andrzej.kaczma...@codecoup.pl>
AuthorDate: Wed Jun 29 16:32:33 2022 +0200

    mfg: Use app pkg FullName to resolve manifest directory
    
    We should use FullName instead of Name since application bin directory
    includes repo designator in its path - this applies to any app,
    including bootloader.
---
 newt/mfg/build.go | 13 ++++++-------
 newt/mfg/emit.go  | 10 +++++-----
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/newt/mfg/build.go b/newt/mfg/build.go
index d39fad0..3122687 100644
--- a/newt/mfg/build.go
+++ b/newt/mfg/build.go
@@ -74,11 +74,11 @@ type MfgBuildMeta struct {
 
 // Can be used to construct an Mfg object.
 type MfgBuilder struct {
-       BasePkg *pkg.LocalPackage
-       Bsp     *pkg.BspPackage
-       Targets []MfgBuildTarget
-       Raws    []MfgBuildRaw
-       Meta    *MfgBuildMeta
+       BasePkg     *pkg.LocalPackage
+       Bsp         *pkg.BspPackage
+       Targets     []MfgBuildTarget
+       Raws        []MfgBuildRaw
+       Meta        *MfgBuildMeta
        BaseAddress int
 }
 
@@ -220,8 +220,7 @@ func newMfgBuildTarget(dt DecodedTarget,
                return MfgBuildTarget{}, err
        }
 
-       mpath := builder.ManifestPath(dt.Name, builder.BUILD_NAME_APP,
-               t.App().Name())
+       mpath := builder.ManifestPath(dt.Name, builder.BUILD_NAME_APP, 
t.App().FullName())
        man, err := manifest.ReadManifest(mpath)
        if err != nil {
                return MfgBuildTarget{}, util.FmtNewtError("%s", err.Error())
diff --git a/newt/mfg/emit.go b/newt/mfg/emit.go
index 7a8068f..6f4ee27 100644
--- a/newt/mfg/emit.go
+++ b/newt/mfg/emit.go
@@ -100,22 +100,22 @@ type MfgEmitter struct {
 func targetSrcBinPath(t *target.Target, isBoot bool) string {
        if isBoot {
                return builder.AppBinPath(t.Name(), builder.BUILD_NAME_APP,
-                       t.App().Name())
+                       t.App().FullName())
        } else {
                return builder.AppImgPath(t.Name(), builder.BUILD_NAME_APP,
-                       t.App().Name())
+                       t.App().FullName())
        }
 }
 
 // Calculates the source path of a target's `.elf` file.
 func targetSrcElfPath(t *target.Target) string {
-       return builder.AppElfPath(t.Name(), builder.BUILD_NAME_APP, 
t.App().Name())
+       return builder.AppElfPath(t.Name(), builder.BUILD_NAME_APP, 
t.App().FullName())
 }
 
 // Calculates the source path of a target's manifest file.
 func targetSrcManifestPath(t *target.Target) string {
        return builder.ManifestPath(t.Name(), builder.BUILD_NAME_APP,
-               t.App().Name())
+               t.App().FullName())
 }
 
 func newMfgEmitTarget(bt MfgBuildTarget) (MfgEmitTarget, error) {
@@ -127,7 +127,7 @@ func newMfgEmitTarget(bt MfgBuildTarget) (MfgEmitTarget, 
error) {
                BinPath: targetSrcBinPath(bt.Target, bt.IsBoot),
                ElfPath: targetSrcElfPath(bt.Target),
                ManifestPath: builder.ManifestPath(bt.Target.Name(),
-                       builder.BUILD_NAME_APP, bt.Target.App().Name()),
+                       builder.BUILD_NAME_APP, bt.Target.App().FullName()),
                ExtraManifest: bt.ExtraManifest,
        }, nil
 }

Reply via email to