You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/01/15 01:20:01 UTC

[GitHub] [mynewt-newt] ccollins476ad opened a new pull request #363: newt upgrade: Fix repo conflict error message

ccollins476ad opened a new pull request #363: newt upgrade: Fix repo conflict error message
URL: https://github.com/apache/mynewt-newt/pull/363
 
 
   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
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-newt] utzig commented on a change in pull request #363: newt upgrade: Fix repo conflict error message

Posted by GitBox <gi...@apache.org>.
utzig commented on a change in pull request #363: newt upgrade: Fix repo conflict error message
URL: https://github.com/apache/mynewt-newt/pull/363#discussion_r366762604
 
 

 ##########
 File path: newt/deprepo/deprepo.go
 ##########
 @@ -236,15 +236,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 == "" || k.Name == r.Name() {
 
 Review comment:
   If `k.Name != ""` in the test above can it ever be `== ""` here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-newt] ccollins476ad merged pull request #363: newt upgrade: Fix repo conflict error message

Posted by GitBox <gi...@apache.org>.
ccollins476ad merged pull request #363: newt upgrade: Fix repo conflict error message
URL: https://github.com/apache/mynewt-newt/pull/363
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [mynewt-newt] ccollins476ad commented on a change in pull request #363: newt upgrade: Fix repo conflict error message

Posted by GitBox <gi...@apache.org>.
ccollins476ad commented on a change in pull request #363: newt upgrade: Fix repo conflict error message
URL: https://github.com/apache/mynewt-newt/pull/363#discussion_r367088854
 
 

 ##########
 File path: newt/deprepo/deprepo.go
 ##########
 @@ -236,15 +236,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 == "" || k.Name == r.Name() {
 
 Review comment:
   You're right, good catch.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services