diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-06-26 23:18:33 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-06-26 23:18:33 -0700 |
commit | 2ea4eab089fff551647ece9270d42a276e601a16 (patch) | |
tree | e5d20a52de990ef68ed55bb73fdf1b9c279d6dd6 /src | |
parent | 0abc4309cea23d72093cd068eaf475ceeaa47976 (diff) | |
download | vyatta-cfg-2ea4eab089fff551647ece9270d42a276e601a16.tar.gz vyatta-cfg-2ea4eab089fff551647ece9270d42a276e601a16.zip |
updated perl api for new cli to support working node representation. not yet functional without additional testing.
Diffstat (limited to 'src')
-rw-r--r-- | src/commit2.c | 24 | ||||
-rw-r--r-- | src/common/unionfs.c | 2 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/commit2.c b/src/commit2.c index 63ccc33..0f83f4a 100644 --- a/src/commit2.c +++ b/src/commit2.c @@ -426,7 +426,13 @@ process_func(GNode *node, gpointer data) status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def); } else { - fprintf(out_stream,"%s\t:\t%s\n",ActionNames[result->_action],d->_path); + char buf[MAX_LENGTH_DIR_PATH*sizeof(char)]; + sprintf(buf,"%s\t:\t%s",ActionNames[result->_action],d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } + fprintf(out_stream,"%s\n",buf); status = 1; } if (result->_action == delete_act) { @@ -974,11 +980,19 @@ validate_func(GNode *node, gpointer data) char *buf = malloc(MAX_LENGTH_DIR_PATH*sizeof(char)); if (IS_DELETE(d->_operation)) { sprintf(buf,"- %s",d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } coll = g_slist_append(coll,buf); result->_data = (void*)&coll; } else if (IS_SET_OR_CREATE(d->_operation)) { sprintf(buf,"+ %s",d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } coll = g_slist_append(coll,buf); result->_data = (void*)&coll; } @@ -1041,7 +1055,13 @@ validate_func(GNode *node, gpointer data) status = execute_list(c->_def.actions[result->_action].vtw_list_head,&c->_def); } else { - fprintf(out_stream,"%s\t:\t%s\n",ActionNames[result->_action],d->_path); + char buf[MAX_LENGTH_DIR_PATH*sizeof(char)]; + sprintf(buf,"%s\t:\t%s",ActionNames[result->_action],d->_path); + if (c->_def.multi) { //need to handle the embedded multinode as a special case--should be fixed! + char *val = (char*)clind_unescape(d->_name); + strcat(buf,val); + } + fprintf(out_stream,"%s\n",buf); status = 1; } diff --git a/src/common/unionfs.c b/src/common/unionfs.c index 80a9ba7..1c39cf8 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -1038,7 +1038,7 @@ dlist_test_func(GQuark key_id,gpointer data,gpointer user_data) } else { new_vn = vn; - strcat(new_vn->_data._path,"/value"); + strcat(new_vn->_data._path,"/"); } new_vn->_data._value = TRUE; strcpy(new_vn->_data._name,(char*)g_quark_to_string(key_id)); |