diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-02-26 17:29:30 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-03-04 17:29:35 +0000 |
commit | f7690df2a8a3596bacd591318c83f15c4315114f (patch) | |
tree | 2634c6a174ffd12ac336482615200b7c8fa529ae | |
parent | 308f77a277c3129b9eac6f1e4e72aca9ed78b022 (diff) | |
download | tbdiff-f7690df2a8a3596bacd591318c83f15c4315114f.tar.gz |
baserock-system-config-sync: Add some logging to the standard output.
-rwxr-xr-x | baserock-system-config-sync/baserock-system-config-sync | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/baserock-system-config-sync/baserock-system-config-sync b/baserock-system-config-sync/baserock-system-config-sync index e4b4e10..ada8de4 100755 --- a/baserock-system-config-sync/baserock-system-config-sync +++ b/baserock-system-config-sync/baserock-system-config-sync @@ -139,18 +139,23 @@ merge_regular_file() { 'exists none none') # Do nothing, if the file was removed in vu and v2 doesn't have it, # then the file is not longer needed + echo "File v1: $v1 was remved by the user, no longer exists" ;; 'none exists none') cp -a "$vu" "$vt" + echo "File vu: $vu created by the user, copied to vt: $vt" ;; 'none none exists') cp -a "$v2" "$vt" + echo "File v2: $v2 only present in the new version, copied to vt: $vt" ;; 'exists none exists') cp -a "$v2" "$vt" + echo "File v2: $v2, erased by the user, copied to vt: $vt" ;; 'exists exists none') cp -a "$vu" "$vt" + echo "File vu: $vu, not present in the new version, copied to vt: $vt" ;; 'none exists exists') cp -a "$v2" "$vt" @@ -160,7 +165,12 @@ merge_regular_file() { if ! (diff -u "$v2" --label="$v2" "$vu" --label="$vu" | patch "$vt" -f); then cp -a "$v2" "$vt" # merge failed, use v2 # 'patch' creates a file '.rej' with the diff that did not apply + echo "File vt: $vt leaved as in v2: $v2, patch didn't apply" + else + echo "File vt: $vt was pached with diff between v2: $v2 and vu: $vu" fi + else + echo "Files vu: $vu and v2: $v2 are the same, not patching" fi ;; 'exists exists exists') @@ -171,7 +181,12 @@ merge_regular_file() { if ! (diff -u "$v1" --label="$v1" "$vu" --label="$vu" | patch "$vt" -f); then cp -a "$v2" "$vt" # merge failed, use v2 # 'patch' creates a file '.rej' with the diff that did not apply + echo "File vt: $vt leaved as in v2: $v2, patch didn't apply" + else + echo "File vt: $vt was pached with diff between v1: $v1 and vu: $vu" fi + else + echo "Files vu: $vu and v2: $v2 are the same, not patching" fi ;; *) |