summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-10-12 17:00:30 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-10-12 17:00:30 -0700
commitf91b92b6e0ddffa5d943b3977fc1e6e1d2cbede9 (patch)
tree39bf963d1a70b1ec1fe5ae608a55b8babf8f30ef
parent964e551fefd6d31ae1a5a873938b4dea619d47c6 (diff)
downloadvyatta-cfg-f91b92b6e0ddffa5d943b3977fc1e6e1d2cbede9.tar.gz
vyatta-cfg-f91b92b6e0ddffa5d943b3977fc1e6e1d2cbede9.zip
followup checkin for fast commit on success behavior. Addresses problem with deleted leafs. Partial regression run on changes, results map to 10/10 build.
-rw-r--r--src/common/unionfs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index c428dfa..35be6ec 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -618,6 +618,8 @@ common_commit_copy_to_live_config(GNode *node, boolean suppress_piecewise_copy,
static const char format0[]="mkdir -p %s ; /bin/true";
static const char formatpoint5[]="rm -fr %s"; /*tmpp*/
static const char format1[]="cp -r -f %s/* %s"; /*mdirp, tmpp*/
+ static const char format1point1[]="mv -f %s/* -t %s"; /*mdirp, tmpp*/
+ static const char format1point5[]="rm -fr %s/*"; /*tmpp*/
static const char format2[]="sudo umount %s"; //mdirp
static const char format8[]="sudo mount -t unionfs -o dirs=%s=rw:%s=ro unionfs %s"; //cdirp, adirp, mdirp
@@ -690,7 +692,16 @@ common_commit_copy_to_live_config(GNode *node, boolean suppress_piecewise_copy,
}
if (suppress_piecewise_copy) {
- sprintf(command, format1, tbuf_root, abuf_root);
+ sprintf(command, format1point5, abuf_root);
+ if (g_debug) {
+ printf("%s\n",command);
+ syslog(LOG_DEBUG,"%s\n",command);
+ fflush(NULL);
+ }
+ if (test_mode == FALSE) {
+ system(command);
+ }
+ sprintf(command, format1point1, tbuf_root, abuf_root);
if (g_debug) {
printf("%s\n",command);
syslog(LOG_DEBUG,"%s\n",command);