Skip to content

Commit

Permalink
Upgrade non-external repos before loading packages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
m-gorecki authored and sjanc committed Nov 24, 2023
1 parent 7dfe546 commit 2728e4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions newt/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 2728e4d

Please sign in to comment.