summaryrefslogtreecommitdiff
path: root/baserock-system-config-sync/baserock-system-config-sync
diff options
context:
space:
mode:
Diffstat (limited to 'baserock-system-config-sync/baserock-system-config-sync')
-rwxr-xr-xbaserock-system-config-sync/baserock-system-config-sync10
1 files changed, 8 insertions, 2 deletions
diff --git a/baserock-system-config-sync/baserock-system-config-sync b/baserock-system-config-sync/baserock-system-config-sync
index 8bc4790..7e02fc1 100755
--- a/baserock-system-config-sync/baserock-system-config-sync
+++ b/baserock-system-config-sync/baserock-system-config-sync
@@ -107,8 +107,14 @@ merge() {
if [ -h "$vu" -a -h "$v1" ]; then
if [ "$(readlink $v1)" == "$(readlink $vu)" ]; then
# User hasn't overriden the old v1 value: switch
- # to v2.
- cp -a "$v2" "$vt"
+ # to v2 if possible, or to vu if v2 doesn't have the
+ # symlink (This behaivour tries to be consistent with
+ # the table in 'merge_regular_file').
+ if [ -e "$v2" ]; then
+ cp -a "$v2" "$vt"
+ else
+ cp -a "$vu" "$vt"
+ fi
else
# User overwrote the v1 value; keep what they did
cp -a "$vu" "$vt"