You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/03/11 04:38:07 UTC
incubator-mynewt-newt git commit: don't check for conflicts with
local repository on upgrade. we do that later.
Repository: incubator-mynewt-newt
Updated Branches:
refs/heads/develop d755636c6 -> 50068cce2
don't check for conflicts with local repository on upgrade. we do that later.
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/50068cce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/50068cce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/50068cce
Branch: refs/heads/develop
Commit: 50068cce24a47e19b78c194639be280e0d842560
Parents: d755636
Author: Sterling Hughes <st...@apache.org>
Authored: Thu Mar 10 18:46:45 2016 -0800
Committer: Sterling Hughes <st...@apache.org>
Committed: Thu Mar 10 19:38:05 2016 -0800
----------------------------------------------------------------------
newt/project/project.go | 2 +-
newt/repo/repo.go | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/50068cce/newt/project/project.go
----------------------------------------------------------------------
diff --git a/newt/project/project.go b/newt/project/project.go
index 6d5e55b..a169963 100644
--- a/newt/project/project.go
+++ b/newt/project/project.go
@@ -306,7 +306,7 @@ func (proj *Project) Install(upgrade bool, force bool) error {
}
// Get repository list, and print every repo and it's dependencies.
- if err := repo.CheckDeps(proj.Repos()); err != nil {
+ if err := repo.CheckDeps(upgrade, proj.Repos()); err != nil {
return err
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/50068cce/newt/repo/repo.go
----------------------------------------------------------------------
diff --git a/newt/repo/repo.go b/newt/repo/repo.go
index faa5503..d4d9f9e 100644
--- a/newt/repo/repo.go
+++ b/newt/repo/repo.go
@@ -85,11 +85,15 @@ func NewRepoDependency(rname string, verstr string) (*RepoDependency, error) {
return rd, nil
}
-func CheckDeps(checkRepos map[string]*Repo) error {
+func CheckDeps(upgrade bool, checkRepos map[string]*Repo) error {
// For each dependency, get it's version
depArray := map[string][]*Version{}
for _, checkRepo := range checkRepos {
+ if checkRepo.Name() == REPO_NAME_LOCAL {
+ continue
+ }
+
for _, rd := range checkRepo.Deps() {
lookupRepo := checkRepos[rd.Name()]
@@ -98,6 +102,7 @@ func CheckDeps(checkRepos map[string]*Repo) error {
return util.NewNewtError(fmt.Sprintf("No "+
"matching version for dependent repository %s", rd.name))
}
+ log.Printf("[DEBUG] Dependency for %s: %s (%s)", checkRepo.Name(), rd.Name(), vers.String())
_, ok = depArray[rd.Name()]
if !ok {
@@ -113,9 +118,9 @@ func CheckDeps(checkRepos map[string]*Repo) error {
if depVers.CompareVersions(depVers, curVers) != 0 ||
depVers.Stability() != curVers.Stability() {
return util.NewNewtError(fmt.Sprintf(
- "Conflict detected. Repository %s has multiple versions. "+
- "Notion of repository version is %s, whereas required is "+
- "%s\n", repoName, curVers, depVers))
+ "Conflict detected. Repository %s has multiple dependency versions on %s. "+
+ "Notion of repository version is %s, whereas required is %s ",
+ repoName, curVers, depVers))
}
}
}