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/03/15 01:26:56 UTC

[20/50] [abbrv] incubator-mynewt-newt git commit: Allow OVERWRITE in yaml sequences.

Allow OVERWRITE in yaml sequences.


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/92fc0d11
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/92fc0d11
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/92fc0d11

Branch: refs/heads/master
Commit: 92fc0d118702cfb9f77ad4bee2ea5ea76acbfb2f
Parents: 30c8cbc
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Mar 14 14:01:50 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Mar 14 14:01:50 2016 -0700

----------------------------------------------------------------------
 newt/newtutil/newtutil.go  | 6 ++++++
 newt/toolchain/compiler.go | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/92fc0d11/newt/newtutil/newtutil.go
----------------------------------------------------------------------
diff --git a/newt/newtutil/newtutil.go b/newt/newtutil/newtutil.go
index 5ebdd92..4fee488 100644
--- a/newt/newtutil/newtutil.go
+++ b/newt/newtutil/newtutil.go
@@ -88,6 +88,12 @@ func GetStringSliceFeatures(v *viper.Viper, features map[string]bool,
 	}
 
 	for item, _ := range features {
+		overwriteVal := v.GetStringSlice(key + "." + item + ".OVERWRITE")
+		if overwriteVal != nil {
+			result = overwriteVal
+			break
+		}
+
 		result = append(result, v.GetStringSlice(key+"."+item)...)
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/92fc0d11/newt/toolchain/compiler.go
----------------------------------------------------------------------
diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index 1d2cb22..1c6b827 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -115,7 +115,10 @@ func loadFlags(v *viper.Viper, features map[string]bool,
 	rawFlags := newtutil.GetStringSliceFeatures(v, features, key)
 	for _, rawFlag := range rawFlags {
 		if strings.HasPrefix(rawFlag, key) {
-			flags = append(flags, strings.Trim(v.GetString(rawFlag), "\n"))
+			expandedFlags := newtutil.GetStringSliceFeatures(v, features,
+				rawFlag)
+
+			flags = append(flags, expandedFlags...)
 		} else {
 			flags = append(flags, strings.Trim(rawFlag, "\n"))
 		}