summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-09-04 21:17:23 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-09-04 21:17:23 -0700
commitf50e8a9c76156a003d07fbca48f35abd24a434d0 (patch)
tree154ddcdb4ed0e3eacc0bd2b4d586d500d95de421 /src
parent00737a5cb32e818a3741aa59ca16e61308367e27 (diff)
downloadvyatta-cfg-f50e8a9c76156a003d07fbca48f35abd24a434d0.tar.gz
vyatta-cfg-f50e8a9c76156a003d07fbca48f35abd24a434d0.zip
added data path to environment during commit. value key is "NODE_DATA_PATH". nodes are delimited by "/" rather than spaces.
Diffstat (limited to 'src')
-rw-r--r--src/commit2.c7
-rw-r--r--src/common/defs.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/commit2.c b/src/commit2.c
index d489923..6274ec6 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -409,6 +409,9 @@ process_func(GNode *node, gpointer data)
set_in_delete_action(TRUE);
}
+ //set location env
+ setenv(ENV_DATA_PATH,d->_path,1);
+
//do last sibling check
GNode *n = g_node_last_sibling(node);
if (n == node) {
@@ -451,6 +454,7 @@ process_func(GNode *node, gpointer data)
unsetenv(ENV_ACTION_NAME);
unsetenv(ENV_SIBLING_POSITION);
+ unsetenv(ENV_DATA_PATH);
if (g_coverage) {
struct timeval t;
@@ -1062,7 +1066,10 @@ validate_func(GNode *node, gpointer data)
boolean status = 1;
if (g_dump_actions == FALSE) {
+ //set location env
+ setenv(ENV_DATA_PATH,d->_path,1);
status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def);
+ unsetenv(ENV_DATA_PATH);
}
else {
char buf[MAX_LENGTH_DIR_PATH*sizeof(char)];
diff --git a/src/common/defs.h b/src/common/defs.h
index daca88a..50d2337 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -16,7 +16,7 @@
#define ENV_ACTION_SET "SET"
#define ENV_ACTION_ACTIVE "ACTIVE"
#define ENV_SIBLING_POSITION "COMMIT_SIBLING_POSITION"
-
+#define ENV_DATA_PATH "NODE_DATA_PATH"
struct Result
{