summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-03-30 12:22:23 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-03-30 12:22:23 -0700
commitb13167543a2ee3265ccb6511760a662430ba1b29 (patch)
treec70f5b2619995518846a74dc760da5a39858ad0f /src
parent5d2ee16e5a36ffec0b563c9554803da6e561d23a (diff)
downloadvyatta-cfg-b13167543a2ee3265ccb6511760a662430ba1b29.tar.gz
vyatta-cfg-b13167543a2ee3265ccb6511760a662430ba1b29.zip
only set env varible for commit action on directly deleted set nodes and do not promote to enclosing transaction scope.
Diffstat (limited to 'src')
-rw-r--r--src/commit2.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/commit2.c b/src/commit2.c
index 3d45e16..a4f5f27 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -365,11 +365,15 @@ process_func(GNode *node, gpointer data)
if (result->_action == delete_act) {
set_in_delete_action(TRUE);
}
- if (IS_DELETE(d->_operation)) {
- setenv(ENV_ACTION_NAME,ENV_ACTION_DELETE,1);
- }
- else {
- setenv(ENV_ACTION_NAME,ENV_ACTION_SET,1);
+
+ //do not set for promoted actions
+ if (!IS_ACTIVE(d->_operation)) {
+ if (IS_DELETE(d->_operation)) {
+ setenv(ENV_ACTION_NAME,ENV_ACTION_DELETE,1);
+ }
+ else {
+ setenv(ENV_ACTION_NAME,ENV_ACTION_SET,1);
+ }
}
if (g_dump_actions == FALSE) {
@@ -388,7 +392,9 @@ process_func(GNode *node, gpointer data)
if (result->_action == delete_act) {
set_in_delete_action(FALSE);
}
- unsetenv(ENV_ACTION_NAME);
+ if (!IS_ACTIVE(d->_operation)) {
+ unsetenv(ENV_ACTION_NAME);
+ }
if (g_coverage) {
struct timeval t;
@@ -669,7 +675,10 @@ dump_func(GNode *node, gpointer data)
if (((struct VyattaNode*)gp)->_data._name != NULL) {
int i;
- if (IS_DELETE(((struct VyattaNode*)gp)->_data._operation)) {
+ if (IS_ACTIVE(((struct VyattaNode*)gp)->_data._operation)) {
+ fprintf(out,"*");
+ }
+ else if (IS_DELETE(((struct VyattaNode*)gp)->_data._operation)) {
fprintf(out,"-");
}
else if (IS_CREATE(((struct VyattaNode*)gp)->_data._operation)) {