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 2016/12/14 20:20:10 UTC

[1/2] incubator-mynewt-newt git commit: newt - The repo compat. check was wrong.

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 5bc0923e4 -> e7971e974


newt - The repo compat. check was wrong.

The previous method of checking if the user has a recent-enough version
of each repo wasn't strict enough.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/7ceb81f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/7ceb81f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/7ceb81f1

Branch: refs/heads/develop
Commit: 7ceb81f11eeef3a4141c219297b0e16328ab9df9
Parents: 5bc0923
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Dec 14 12:17:26 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Wed Dec 14 12:17:26 2016 -0800

----------------------------------------------------------------------
 newt/repo/repo.go | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7ceb81f1/newt/repo/repo.go
----------------------------------------------------------------------
diff --git a/newt/repo/repo.go b/newt/repo/repo.go
index fe4a5bc..c02d6e6 100644
--- a/newt/repo/repo.go
+++ b/newt/repo/repo.go
@@ -577,21 +577,32 @@ func (r *Repo) HasMinCommit() (bool, error) {
 
 	cmd := []string{
 		"git",
-		"rev-list",
-		r.minCommit.Hash + "..HEAD",
+		"merge-base",
+		r.minCommit.Hash,
+		"HEAD",
 	}
-
-	o, err := util.ShellCommand(cmd, nil)
+	mergeBase, err := util.ShellCommand(cmd, nil)
 	if err != nil {
 		return false, util.ChildNewtError(err)
 	}
-
-	if len(o) == 0 {
+	if len(mergeBase) == 0 {
 		// No output means the commit does not exist in the current branch.
 		return false, nil
 	}
 
-	return true, nil
+	cmd = []string{
+		"git",
+		"rev-parse",
+		"--verify",
+		r.minCommit.Hash,
+	}
+	revParse, err := util.ShellCommand(cmd, nil)
+	if err != nil {
+		return false, util.ChildNewtError(err)
+	}
+
+	// The commit exists in HEAD if the two commands produced identical output.
+	return string(mergeBase) == string(revParse), nil
 }
 
 func (r *Repo) Init(repoName string, rversreq string, d downloader.Downloader) error {


[2/2] incubator-mynewt-newt git commit: newt - Update min-commits due to compat-brkng chgs

Posted by cc...@apache.org.
newt - Update min-commits due to compat-brkng chgs

Recently, newt changed the way it compiles source files.  Specifically,
it used to cd to each source directory when compiling; now it builds
everything from the project base directory.  Mynewt repos had to be
updated to accommodate this change: their -I cflags needed to specify
paths relative to the project directory.

This commit ensures the user isn't using a new newt tool with an old set
of repos.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/e7971e97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/e7971e97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/e7971e97

Branch: refs/heads/develop
Commit: e7971e97459dfe00890cd8a1191136aad53c6836
Parents: 7ceb81f
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Dec 14 12:18:10 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Wed Dec 14 12:18:10 2016 -0800

----------------------------------------------------------------------
 newt/newtutil/newtutil.go | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e7971e97/newt/newtutil/newtutil.go
----------------------------------------------------------------------
diff --git a/newt/newtutil/newtutil.go b/newt/newtutil/newtutil.go
index f391906..c4dab1b 100644
--- a/newt/newtutil/newtutil.go
+++ b/newt/newtutil/newtutil.go
@@ -41,6 +41,7 @@ const NEWTRC_DIR string = ".newt"
 const REPOS_FILENAME string = "repos.yml"
 
 const CORE_REPO_NAME string = "apache-mynewt-core"
+const ARDUINO_ZERO_REPO_NAME string = "mynewt_arduino_zero"
 
 type RepoCommitEntry struct {
 	Version string
@@ -49,11 +50,16 @@ type RepoCommitEntry struct {
 
 // A warning is displayed if newt requires a newer version of a repo.
 var RepoMinCommits = map[string]*RepoCommitEntry{
-	// Newt no longer invokes the shell for external commands.  Some YAML files
-	// in core had to be fixed to accommodate this change.
+	// Newt no longer cd's to a source directory when it compiles its contents.
+	// Consequently, package include flags need to be relative to the project
+	// directory, not the package source directory.
 	CORE_REPO_NAME: &RepoCommitEntry{
 		Version: "develop",
-		Hash:    "5c5a987ef72ae9b3eb682f19d7d0bdc85f7e500c",
+		Hash:    "cd99344df197d5b9e372b93142184a39ec078f69",
+	},
+	ARDUINO_ZERO_REPO_NAME: &RepoCommitEntry{
+		Version: "develop",
+		Hash:    "a6348961fef56dbfe09a1b9418d3add3ad22eaf2",
 	},
 }