diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-10-15 21:52:34 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-10-15 21:52:34 -0700 |
commit | 0437ad64813fb30beb05dcd76b50a1d95c1e3f00 (patch) | |
tree | 25b33938d9a6dfce562986fe53b8b3011ed0c756 | |
parent | 3040da4353f4814060406404b80d2c2eea965f3f (diff) | |
download | vyatta-cfg-0437ad64813fb30beb05dcd76b50a1d95c1e3f00.tar.gz vyatta-cfg-0437ad64813fb30beb05dcd76b50a1d95c1e3f00.zip |
new commit mode for debugging.
-b
Breaks on each priority group before execution and waits for user keystroke to proceed. this allows for examination of system before and after each priority group has been applied
-rw-r--r-- | src/commit2.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/commit2.c b/src/commit2.c index 42f2ce5..52bcd68 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -108,6 +108,7 @@ usage(void) printf("\t-c\t\tdump node coverage and execution times\n"); printf("\t-o\t\tdisable partial commit\n"); printf("\t-f\t\tfull iteration over configuration on commit check\n"); + printf("\t-b\t\tbreak on each priority node (debug mode)\n"); printf("\t-h\t\thelp\n"); } @@ -123,12 +124,13 @@ main(int argc, char** argv) boolean test_mode = FALSE; boolean disable_partial_commit = FALSE; boolean full_commit_check = FALSE; + boolean break_priority = FALSE; /* this is needed before calling certain glib functions */ g_type_init(); //grab inputs - while ((ch = getopt(argc, argv, "dpthsecoaf")) != -1) { + while ((ch = getopt(argc, argv, "dpthsecoafb")) != -1) { switch (ch) { case 'd': g_debug = TRUE; @@ -161,6 +163,9 @@ main(int argc, char** argv) case 'f': full_commit_check = TRUE; break; + case 'b': + break_priority = TRUE; + break; default: usage(); exit(0); @@ -241,6 +246,21 @@ main(int argc, char** argv) } } + if (break_priority) { + g_dump_trans = TRUE; + g_node_traverse(trans_child_node, + G_PRE_ORDER, + G_TRAVERSE_ALL, + -1, + (GNodeTraverseFunc)dump_func, + (gpointer)NULL); + g_dump_trans = FALSE; + fprintf(out_stream,"Press any key to commit...\n"); + + // Wait for single character + char input = getchar(); + } + //complete() now requires a undisturbed copy of the trans_child_node tree GNode *comp_cp_node = g_node_copy(trans_child_node); |