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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2728e4d2 Upgrade non-external repos before loading packages
2728e4d2 is described below

commit 2728e4d2449e2a59309bb9f19a0a5fa20cb63063
Author: Michal Gorecki <michal.gore...@codecoup.pl>
AuthorDate: Thu Oct 26 10:30:09 2023 +0200

    Upgrade non-external repos before loading packages
    
    Thanks to this, we will upgrade external repos to proper versions,
    instead of always upgrading them to versions set in pkg files
    from master branches of non-external repos.
    
    I.e. if mynewt-core will be upgraded to version 1.11.0,
    external repos included in mynewt-core pkg.yml files
    are going be downloaded and upgraded as specified
    in those files from mynewt_1_11_0_tag. Without this
    external repos included in mynewt-core would be upgraded
    to versions specified in pkgs from mynewt-core's
    master branch, which would lead to versions mismatch and
    probably compilation errors
---
 newt/project/project.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/newt/project/project.go b/newt/project/project.go
index 45ecaf32..754206e7 100644
--- a/newt/project/project.go
+++ b/newt/project/project.go
@@ -92,6 +92,15 @@ func initProject(dir string, download bool) error {
        if err != nil {
                return err
        }
+
+       if download {
+               err = globalProject.UpgradeIf(newtutil.NewtForce, 
newtutil.NewtAsk,
+                                             func(r *repo.Repo) bool { return 
!r.IsExternal(r.Path()) })
+               if err != nil {
+                       return err
+               }
+       }
+
        if err := globalProject.loadPackageList(); err != nil {
                return err
        }

Reply via email to