[asterisk-commits] branch group/autoconf_and_menuselect r11116 - /team/group/autoconf_and_menuse...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Feb 25 07:23:25 MST 2006


Author: russell
Date: Sat Feb 25 08:23:23 2006
New Revision: 11116

URL: http://svn.digium.com/view/asterisk?rev=11116&view=rev
Log:
don't bail before running the menu if an incomplete menuselect.makesopts file
existed when menuselect is executed without the --check-deps option

Modified:
    team/group/autoconf_and_menuselect/build_tools/menuselect.c

Modified: team/group/autoconf_and_menuselect/build_tools/menuselect.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/menuselect.c?rev=11116&r1=11115&r2=11116&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/menuselect.c (original)
+++ team/group/autoconf_and_menuselect/build_tools/menuselect.c Sat Feb 25 08:23:23 2006
@@ -118,6 +118,9 @@
 
 /*! This is set to 1 if menuselect.makeopts pre-existed the execution of this app */
 int existing_config = 0;
+
+/*! This is set when the --check-deps argument is provided. */
+int check_deps = 0;
 
 /*! \brief a wrapper for calloc() that generates an error message if the allocation fails */
 static inline void *my_calloc(size_t num, size_t len)
@@ -333,7 +336,7 @@
 					break; /* This dependency is not met, so we can stop now */
 			}
 			if (mem->depsfailed) {
-				if (existing_config && mem->enabled) {
+				if (check_deps && existing_config && mem->enabled) {
 					/* Config already existed, but this module was not disabled.
 					 * However, according to our current list of dependencies that
 					 * have been met, this can not be built. */
@@ -796,7 +799,7 @@
 			break;	
 		}
 		if (c == 'q') {
-			res = 1;
+			res = -1;
 			break;
 		}
 		if (c == 'x')
@@ -820,30 +823,28 @@
 	/* Read in the existing makeopts, if they exist */
 	parse_existing_config();
 
+	if (argc == 2 && !strcmp(argv[1], "--check-deps")) {
+		check_deps = 1;
+		/* Set to greater than 0 so that we won't run the menu
+		   or write out a new file, but we will still exit with
+		   a return code of 0 */
+		res = 1;
+	}
+
 	/* Process module dependencies */
-	if ((res = process_deps()))
-		goto cleanup_allocations;
+	res = process_deps();
 
 #ifdef MENUSELECT_DEBUG
 	/* Dump the list produced by parsing the various input files */
 	dump_member_list();
 #endif
 
-	if (argc == 2 && !strcmp(argv[1], "--check-deps")) {
-		/* Set to greater than 0 so that we won't run the menu
-		   or write out a new file, but we will still exit with
-		   a return code of 0 */
-		res = 1;
-	}
-		
 	/* Run the menu to let the user enable/disable options */
-	if (!res)
-		res = run_menu();
-
-	if (!res)
-		res = generate_makeopts_file(); /* If all is good, save the new config */
-
-cleanup_allocations:
+	if (!check_deps) {
+		if (!(res = run_menu()))
+			res = generate_makeopts_file(); /* If all is good, save the new config */
+	}
+
 	/* free everything we allocated */
 	free_trees();
 	free_member_list();



More information about the asterisk-commits mailing list