[svn-commits] branch group/autoconf_and_menuselect r18435 - /team/group/autoconf_and_menuse...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Apr 7 15:03:38 MST 2006


Author: russell
Date: Fri Apr  7 17:03:37 2006
New Revision: 18435

URL: http://svn.digium.com/view/asterisk?rev=18435&view=rev
Log:
add the ability to set that when an option in a certain category gets changed,
to force a clean of the tree

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

Modified: team/group/autoconf_and_menuselect/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/cflags.xml?rev=18435&r1=18434&r2=18435&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/cflags.xml (original)
+++ team/group/autoconf_and_menuselect/build_tools/cflags.xml Fri Apr  7 17:03:37 2006
@@ -1,4 +1,4 @@
-	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes">
+	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
 		<member name="-DDEBUG_SCHEDULER"/>
 		<member name="-DDEBUG_THREADS"/>
 		<member name="-DDETECT_DEADLOCKS"/>

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=18435&r1=18434&r2=18435&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/menuselect.c (original)
+++ team/group/autoconf_and_menuselect/build_tools/menuselect.c Fri Apr  7 17:03:37 2006
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include <signal.h>
 #include <curses.h>
 
@@ -81,6 +82,8 @@
 	const char *displayname;
 	/*! Display what is selected, as opposed to not selected */
 	int positive_output;
+	/*! Force a clean of the source tree if anything in this category changes */
+	int force_clean_on_change;
 	/*! the list of possible values to be set in this variable */
 	AST_LIST_HEAD_NOLOCK(, member) members;
 	/*! for linking */
@@ -122,6 +125,9 @@
 /*! This is set when the --check-deps argument is provided. */
 int check_deps = 0;
 
+/*! Force a clean of the source tree */
+int force_clean = 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)
 {
@@ -205,12 +211,12 @@
 	}
 
 	if (!(tree = my_calloc(1, sizeof(*tree)))) {
-		close(f);
+		fclose(f);
 		return -1;
 	}
 
 	if (!(tree->root = mxmlLoadFile(NULL, f, MXML_OPAQUE_CALLBACK))) {
-		close(f);
+		fclose(f);
 		free(tree);
 		return -1;
 	}
@@ -240,6 +246,8 @@
 		cat->displayname = mxmlElementGetAttr(cur, "displayname");
 		if ((tmp = mxmlElementGetAttr(cur, "positive_output")))
 			cat->positive_output = !strcasecmp(tmp, "yes");
+		if ((tmp = mxmlElementGetAttr(cur, "force_clean_on_change")))
+			cat->force_clean_on_change = !strcasecmp(tmp, "yes");
 
 		if (add_category(cat)) {
 			free(cat);
@@ -280,7 +288,7 @@
 		}
 	}
 
-	close(f);
+	fclose(f);
 
 	return 0;
 }
@@ -322,7 +330,7 @@
 		memset(buf, 0, sizeof(buf));
 	}
 
-	close(f);
+	fclose(f);
 
 	/* Process dependencies of all modules */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
@@ -418,8 +426,11 @@
 			break;
 	}
 
-	if (mem && !mem->depsfailed)
+	if (mem && !mem->depsfailed) {
 		mem->enabled = !mem->enabled;
+		if (cat->force_clean_on_change)
+			force_clean = 1;
+	}
 }
 
 /*! \brief Parse an existing output makeopts file and enable members previously selected */
@@ -468,7 +479,7 @@
 		}
 	}
 
-	close(f);
+	fclose(f);
 }
 
 /*! \brief Create the output makeopts file that results from the user's selections */
@@ -494,7 +505,7 @@
 		fprintf(f, "\n");
 	}
 
-	close(f);
+	fclose(f);
 
 	return 0;
 }
@@ -867,5 +878,8 @@
 		res = -1;
 	}
 
+	if (force_clean)
+		unlink(".lastclean");
+
 	exit(res);
 }



More information about the svn-commits mailing list