You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2020/03/25 20:47:12 UTC
[mynewt-newt] 02/02: Use rc-tag-inference in inter-repo dependencies
This is an automated email from the ASF dual-hosted git repository.
ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
commit b8147e0284cf75765799a79f6ec0f57a49542a50
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Tue Mar 24 16:54:37 2020 -0700
Use rc-tag-inference in inter-repo dependencies
A repo can specify dependencies in its `repository.yml` file, e.g.,
repo.deps:
apache-mynewt-nimble:
type: github
user: apache
repo: mynewt-nimble
vers:
mynewt_1_4_0_tag: 1.0.0
The `mynewt_1_4_0_tag` tag of *this repo* depends on nimble 1.0.0. If
`mynewt_1_4_0_tag` does not exist, then `newt upgrade` would fail.
The tag-validity check that newt was doing here was too strict. If the
specified tag doesn't exist, newt should attempt rc-tag-inference. For
example, if `mynewt_1_4_0_tag` does not exist, newt should check for the
latest corresponding rc tag (e.g., `mynewt_1_4_0_rc1_tag`). If one is
found, then the dependency list is valid after all.
Newt already applies this rc-tag-inference procedure when it actually
performs the upgrade. However, the check that happens before the
upgrade was not using rc-tag-inference. This commit adds
rc-tag-inference to this check.
---
newt/install/install.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/newt/install/install.go b/newt/install/install.go
index 5bc5f0c..c26e956 100644
--- a/newt/install/install.go
+++ b/newt/install/install.go
@@ -423,6 +423,11 @@ func (inst *Installer) calcVersionMap(candidates []*repo.Repo) (
for _, r := range repoList {
for commit, _ := range r.CommitDepMap() {
+ commit, err := r.Downloader().LatestRc(r.Path(), commit)
+ if err != nil {
+ return nil, err
+ }
+
equiv, err := r.Downloader().CommitsFor(r.Path(), commit)
if err != nil {
return nil, err