From 1a129d69b000a2ee7bba31fddbeed4f34a5551ce Mon Sep 17 00:00:00 2001
From: slioch <slioch@eng-140.vyatta.com>
Date: Mon, 30 Mar 2009 14:39:30 -0700
Subject: added noop state to commit_action env variable to make scripts happy.

---
 src/commit2.c     | 8 +++++---
 src/common/defs.h | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/commit2.c b/src/commit2.c
index a4f5f27..7f81850 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -375,6 +375,9 @@ process_func(GNode *node, gpointer data)
 	  setenv(ENV_ACTION_NAME,ENV_ACTION_SET,1);
 	}
       }
+      else {
+	  setenv(ENV_ACTION_NAME,ENV_ACTION_NOOP,1);
+      }
 
       if (g_dump_actions == FALSE) {
 	status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def);
@@ -392,9 +395,8 @@ process_func(GNode *node, gpointer data)
       if (result->_action == delete_act) {
 	set_in_delete_action(FALSE);
       }
-      if (!IS_ACTIVE(d->_operation)) {
-	unsetenv(ENV_ACTION_NAME);
-      }
+
+      unsetenv(ENV_ACTION_NAME);
 
       if (g_coverage) {
 	struct timeval t;
diff --git a/src/common/defs.h b/src/common/defs.h
index a26bfbc..d634b8c 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -14,7 +14,7 @@
 #define ENV_ACTION_NAME "COMMIT_ACTION"
 #define ENV_ACTION_DELETE "DELETE"
 #define ENV_ACTION_SET "SET"
-
+#define ENV_ACTION_NOOP "NOOP"
 
 struct Result
 {
-- 
cgit v1.2.3