[asterisk-commits] trunk r31443 - /trunk/build_tools/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jun 1 10:40:50 MST 2006


Author: russell
Date: Thu Jun  1 12:40:50 2006
New Revision: 31443

URL: http://svn.digium.com/view/asterisk?rev=31443&view=rev
Log:
allow menuselect to display dependencies and conflicts for modules

Modified:
    trunk/build_tools/menuselect.c
    trunk/build_tools/menuselect.h
    trunk/build_tools/menuselect_curses.c

Modified: trunk/build_tools/menuselect.c
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/menuselect.c?rev=31443&r1=31442&r2=31443&view=diff
==============================================================================
--- trunk/build_tools/menuselect.c (original)
+++ trunk/build_tools/menuselect.c Thu Jun  1 12:40:50 2006
@@ -39,20 +39,6 @@
 #include "asterisk/linkedlists.h"
 
 #undef MENUSELECT_DEBUG
-
-struct depend {
-	/*! the name of the dependency */
-	const char *name;
-	/*! for linking */
-	AST_LIST_ENTRY(depend) list;
-};
-
-struct conflict {
-	/*! the name of the conflict */
-	const char *name;
-	/*! for linking */
-	AST_LIST_ENTRY(conflict) list;
-};
 
 /*! The list of categories */
 struct categories categories = AST_LIST_HEAD_NOLOCK_INIT_VALUE;

Modified: trunk/build_tools/menuselect.h
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/menuselect.h?rev=31443&r1=31442&r2=31443&view=diff
==============================================================================
--- trunk/build_tools/menuselect.h (original)
+++ trunk/build_tools/menuselect.h Thu Jun  1 12:40:50 2006
@@ -31,8 +31,19 @@
 #define OUTPUT_MAKEOPTS_DEFAULT "menuselect.makeopts"
 #define MENUSELECT_DEPS         "build_tools/menuselect-deps"
 
-struct depend;
-struct conflict;
+struct depend {
+	/*! the name of the dependency */
+	const char *name;
+	/*! for linking */
+	AST_LIST_ENTRY(depend) list;
+};
+
+struct conflict {
+	/*! the name of the conflict */
+	const char *name;
+	/*! for linking */
+	AST_LIST_ENTRY(conflict) list;
+};
 
 struct member {
 	/*! What will be sent to the makeopts file */

Modified: trunk/build_tools/menuselect_curses.c
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/menuselect_curses.c?rev=31443&r1=31442&r2=31443&view=diff
==============================================================================
--- trunk/build_tools/menuselect_curses.c (original)
+++ trunk/build_tools/menuselect_curses.c Thu Jun  1 12:40:50 2006
@@ -126,7 +126,9 @@
 {
 	int i = 0;
 	int j = 0;
-	struct member *mem;
+	struct member *mem, *curmem = NULL;
+	struct depend *dep;
+	struct conflict *con;
 	char buf[64];
 	const char *desc = NULL;
 
@@ -146,15 +148,35 @@
 		waddstr(menu, buf);
 		
 		if (curopt + 1 == i)
-			desc = mem->displayname;
+			curmem = mem;
 
 		if (i == end)
 			break;
 	}
 
-	if (desc) {
+	if (curmem->displayname) {
 		wmove(menu, end - start + 2, max_x / 2 - 16);
-		waddstr(menu, desc);
+		waddstr(menu, curmem->displayname);
+	}
+	if (!AST_LIST_EMPTY(&curmem->deps)) {
+		wmove(menu, end - start + 3, max_x / 2 - 16);
+		snprintf(buf, sizeof(buf), "Depends on: ");
+		AST_LIST_TRAVERSE(&curmem->deps, dep, list) {
+			strncat(buf, dep->name, sizeof(buf) - strlen(buf) - 1);
+			if (AST_LIST_NEXT(dep, list))
+				strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1);
+		}
+		waddstr(menu, buf);
+	}
+	if (!AST_LIST_EMPTY(&curmem->conflicts)) {
+		wmove(menu, end - start + 4, max_x / 2 - 16);
+		snprintf(buf, sizeof(buf), "Conflicts with: ");
+		AST_LIST_TRAVERSE(&curmem->conflicts, con, list) {
+			strncat(buf, con->name, sizeof(buf) - strlen(buf) - 1);
+			if (AST_LIST_NEXT(con, list))
+				strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1);
+		}
+		waddstr(menu, buf);
 	}
 	wmove(menu, curopt - start, max_x / 2 - 9);
 



More information about the asterisk-commits mailing list