[svn-commits] russell: trunk r474 - in /trunk: ./ menuselect.c menuselect.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 12 10:34:10 CST 2009


Author: russell
Date: Thu Feb 12 10:34:10 2009
New Revision: 474

URL: http://svn.digium.com/svn-view/menuselect?view=rev&rev=474
Log:
Merged revisions 473 via svnmerge from 
https://origsvn.digium.com/svn/menuselect/branches/1.0

........
  r473 | russell | 2009-02-12 10:32:32 -0600 (Thu, 12 Feb 2009) | 5 lines
  
  Fix an issue related to processing default values after reading existing config.
  
  (closes issue #14137)
  Reported by: jnemeth
........

Modified:
    trunk/   (props changed)
    trunk/menuselect.c
    trunk/menuselect.h

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.0-merged (original)
+++ branch-1.0-merged Thu Feb 12 10:34:10 2009
@@ -1,1 +1,1 @@
-/branches/1.0:1-316,383,437,465,467
+/branches/1.0:1-316,383,437,465,467,473

Modified: trunk/menuselect.c
URL: http://svn.digium.com/svn-view/menuselect/trunk/menuselect.c?view=diff&rev=474&r1=473&r2=474
==============================================================================
--- trunk/menuselect.c (original)
+++ trunk/menuselect.c Thu Feb 12 10:34:10 2009
@@ -770,6 +770,7 @@
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
 			if (!strcmp(member, mem->name)) {
 				mem->was_enabled = mem->enabled = (negate ? !cat->positive_output : cat->positive_output);
+				mem->was_present = 1;
 				print_debug("Just set %s enabled to %d\n", mem->name, mem->enabled);
 				break;
 			}
@@ -1392,14 +1393,17 @@
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
-			if (!mem->defaultenabled)
+			if (!mem->defaultenabled || mem->was_present) {
 				continue;
-
-			if (mem->depsfailed == HARD_FAILURE)
+			}
+
+			if (mem->depsfailed == HARD_FAILURE) {
 				continue;
-
-			if (mem->conflictsfailed == HARD_FAILURE)
+			}
+
+			if (mem->conflictsfailed == HARD_FAILURE) {
 				continue;
+			}
 			
 			if (!strcasecmp(mem->defaultenabled, "yes")) {
 				mem->enabled = 1;
@@ -1455,10 +1459,11 @@
 
 	while (calc_dep_failures(0, 0) || calc_conflict_failures(0, 0));
 
-	if (!existing_config)
-		process_defaults();
-	else if (check_deps)
+	process_defaults();
+	
+	if (check_deps) {
 		res = sanity_check();
+	}
 
 	while (calc_dep_failures(0, 0) || calc_conflict_failures(0, 0));
 	

Modified: trunk/menuselect.h
URL: http://svn.digium.com/svn-view/menuselect/trunk/menuselect.h?view=diff&rev=474&r1=473&r2=474
==============================================================================
--- trunk/menuselect.h (original)
+++ trunk/menuselect.h Thu Feb 12 10:34:10 2009
@@ -96,6 +96,9 @@
 	  we have included it in the MENUSELECT_BUILD_DEPS line
 	  in the output file */
 	unsigned int build_deps_output:1;
+	/*! This member was present in an existing configuration file, so don't
+	 * mess with it when processing default values. */
+	unsigned int was_present:1;
 	/*! dependencies of this module */
 	AST_LIST_HEAD_NOLOCK(, depend) deps;
 	/*! conflicts of this module */




More information about the svn-commits mailing list