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/01/16 00:25:59 UTC

[mynewt-newt] branch master updated (d6924cb -> 83b9f57)

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

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


    from d6924cb  install: Warn user about invalid commit strings
     new 56eafd0  newt upgrade: Fix repo conflict error message
     new 83b9f57  Exclude `project.yml` as rev-depgraph node key

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 newt/deprepo/deprepo.go | 21 +++++++++++++--------
 newt/deprepo/graph.go   | 13 ++++++++-----
 newt/install/install.go |  9 +++++++--
 3 files changed, 28 insertions(+), 15 deletions(-)


[mynewt-newt] 01/02: newt upgrade: Fix repo conflict error message

Posted by cc...@apache.org.
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 56eafd01c2b4adba9d7e680bf09f74832e14ba4f
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Tue Jan 14 17:11:01 2020 -0800

    newt upgrade: Fix repo conflict error message
    
    If a `newt upgrade` operation fails due to conflicting repo
    requirements, the error message should indicate which requirements are
    in conflict.  The bug was that the error message was missing "root
    requirements" (requirements specified in project.yml), so the message
    was incomplete.
    
    For example (before fix):
    
        Error: Repository conflicts:
            Installation of repo "mynewt-dummy-repo-04" is blocked:
                mynewt-dummy-repo-01,1.0.0 requires mynewt-dummy-repo-04 ==1.0.0
    
    After fix:
    
        Error: Repository conflicts:
            Installation of repo "mynewt-dummy-repo-04" is blocked:
                               project.yml requires mynewt-dummy-repo-04 ==1.0.2/0eaf06337c8f8dc8c49fffa884a6a0c2fb223d73
                mynewt-dummy-repo-01,1.0.0 requires mynewt-dummy-repo-04 ==1.0.0
---
 newt/deprepo/deprepo.go | 21 +++++++++++++--------
 newt/install/install.go |  9 +++++++--
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/newt/deprepo/deprepo.go b/newt/deprepo/deprepo.go
index f42a5d7..e518e26 100644
--- a/newt/deprepo/deprepo.go
+++ b/newt/deprepo/deprepo.go
@@ -238,15 +238,20 @@ func PruneMatrix(m *Matrix, repos RepoMap, rootReqs RequirementMap) error {
 // of repos in the project.
 func PruneDepGraph(dg DepGraph, keep []*repo.Repo) {
 	for k, _ := range dg {
-		found := false
-		for _, r := range keep {
-			if r.Name() == k.Name {
-				found = true
-				break
+		// The empty string indicates a `project.yml` requirement.  Always
+		// keep these.
+		if k.Name != "" {
+			found := false
+
+			for _, r := range keep {
+				if k.Name == r.Name() {
+					found = true
+					break
+				}
+			}
+			if !found {
+				delete(dg, k)
 			}
-		}
-		if !found {
-			delete(dg, k)
 		}
 	}
 }
diff --git a/newt/install/install.go b/newt/install/install.go
index ef3d18f..c25cfd1 100644
--- a/newt/install/install.go
+++ b/newt/install/install.go
@@ -670,8 +670,13 @@ func (inst *Installer) calcVersionMap(candidates []*repo.Repo) (
 	for name, nodes := range rg {
 		for _, node := range nodes {
 			if newtutil.CompareRepoVersions(node.Ver, vm[node.Name]) == 0 {
-				if err := inst.assignCommits(vm, name, node.VerReqs, false); err != nil {
-					return nil, err
+				// Don't consider project.yml dependencies here.  Those get
+				// assigned last so that they can override inter-repo
+				// dependencies.
+				if node.Name != "" {
+					if err := inst.assignCommits(vm, name, node.VerReqs, false); err != nil {
+						return nil, err
+					}
 				}
 			}
 		}


[mynewt-newt] 02/02: Exclude `project.yml` as rev-depgraph node key

Posted by cc...@apache.org.
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 83b9f570009b665f407032ff382746835847393d
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Wed Jan 15 12:27:06 2020 -0800

    Exclude `project.yml` as rev-depgraph node key
    
    This commit changes the debug log output.
    
    Nothing ever depends on `project.yml`, so don't include it as a node key
    in reverse dependency graphs.  This change removes some zero-information
    lines from the debug output.
---
 newt/deprepo/graph.go | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/newt/deprepo/graph.go b/newt/deprepo/graph.go
index e482562..557b2ce 100644
--- a/newt/deprepo/graph.go
+++ b/newt/deprepo/graph.go
@@ -192,11 +192,14 @@ func (dg DepGraph) Reverse() RevdepGraph {
 
 	for dependent, nodes := range dg {
 		for _, node := range nodes {
-			rg[node.Name] = append(rg[node.Name], RevdepGraphNode{
-				Name:    dependent.Name,
-				Ver:     dependent.Ver,
-				VerReqs: node.VerReqs,
-			})
+			// Nothing depends on project.yml (""), so exclude it from the result.
+			if node.Name != "" {
+				rg[node.Name] = append(rg[node.Name], RevdepGraphNode{
+					Name:    dependent.Name,
+					Ver:     dependent.Ver,
+					VerReqs: node.VerReqs,
+				})
+			}
 		}
 	}