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:24:29 UTC

[mynewt-newt] 01/02: Sort result of VersionMap.String()

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 4655fa1d214df01d20e3cfe831c56e75b7eec2d8
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Mon Jan 13 16:08:58 2020 -0800

    Sort result of VersionMap.String()
---
 newt/deprepo/deprepo.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/newt/deprepo/deprepo.go b/newt/deprepo/deprepo.go
index c6878dc..f42a5d7 100644
--- a/newt/deprepo/deprepo.go
+++ b/newt/deprepo/deprepo.go
@@ -75,11 +75,13 @@ func (rm RepoMap) Sorted() []*repo.Repo {
 func (vm VersionMap) String() string {
 	s := ""
 
-	for repoName, ver := range vm {
+	names := vm.SortedNames()
+	for _, name := range names {
+		ver := vm[name]
 		if len(s) > 0 {
 			s += "\n"
 		}
-		s += fmt.Sprintf("%s:%s", repoName, ver.String())
+		s += fmt.Sprintf("%s:%s", name, ver.String())
 	}
 	return s
 }