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 2018/02/23 18:55:43 UTC

[GitHub] ccollins476ad closed pull request #138: newt - Don't abort if setting is redefined.

ccollins476ad closed pull request #138: newt - Don't abort if setting is redefined.
URL: https://github.com/apache/mynewt-newt/pull/138
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/newt/syscfg/syscfg.go b/newt/syscfg/syscfg.go
index 722d8f49..3de31bb2 100644
--- a/newt/syscfg/syscfg.go
+++ b/newt/syscfg/syscfg.go
@@ -330,12 +330,13 @@ func (cfg *Cfg) readDefsOnce(lpkg *pkg.LocalPackage,
 			}
 
 			if oldEntry, exists := cfg.Settings[k]; exists {
-				// Setting already defined.  Allow this only if the setting is
-				// injected, in which case the injected value takes precedence.
+				// Setting already defined.  Warn the user and keep the
+				// original definition.
 				point := mostRecentPoint(oldEntry)
 				if !point.IsInjected() {
-					// XXX: Better error message.
-					return util.FmtNewtError("setting %s redefined", k)
+					util.StatusMessage(util.VERBOSITY_QUIET,
+						"* Warning: setting %s redefined (pkg1=%s pkg2=%s)\n",
+						k, point.Source.Name(), lpkg.Name())
 				}
 
 				entry.History = append(entry.History, oldEntry.History...)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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