summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-02-25 16:35:07 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-03-05 17:12:12 (GMT)
commit5ce7b18b7ebc9c2fb6c431424646ed0dad0f1215 (patch)
tree478441eb5395978f1d5b8f98f58d65f891dfe050
parentf585763060076fdd5104409554613b9ca110f910 (diff)
downloadtbdiff-5ce7b18b7ebc9c2fb6c431424646ed0dad0f1215.tar.gz
Fix behaviour in bscs-merge when vUser and v2 don't have a file of v1
If a file was removed in vUser, and v2 doesn't have a new one, then the file is not longer needed.
-rwxr-xr-xbaserock-system-config-sync/baserock-system-config-sync5
-rw-r--r--tests/bscs-merge.pass/upgrades.out/systems/version2/run/etc/file12
2 files changed, 3 insertions, 4 deletions
diff --git a/baserock-system-config-sync/baserock-system-config-sync b/baserock-system-config-sync/baserock-system-config-sync
index e297197..a1a4a85 100755
--- a/baserock-system-config-sync/baserock-system-config-sync
+++ b/baserock-system-config-sync/baserock-system-config-sync
@@ -123,7 +123,7 @@ merge_regular_file() {
# V1 Vuser V2 action
# ------------------------------------------
# none none none inconceivable!
- # exists none none use V1
+ # exists none none do nothing
# none exists none use Vuser
# none none exists use V2
# exists none exists use V2
@@ -137,7 +137,8 @@ merge_regular_file() {
case "$v1_exists $vu_exists $v2_exists" in
'exists none none')
- cp -a "$v1" "$vt"
+ # Do nothing, if the file was removed in vu and v2 doesn't have it,
+ # then the file is not longer needed
;;
'none exists none')
cp -a "$vu" "$vt"
diff --git a/tests/bscs-merge.pass/upgrades.out/systems/version2/run/etc/file1 b/tests/bscs-merge.pass/upgrades.out/systems/version2/run/etc/file1
deleted file mode 100644
index b73be5d..0000000
--- a/tests/bscs-merge.pass/upgrades.out/systems/version2/run/etc/file1
+++ /dev/null
@@ -1,2 +0,0 @@
-whereami=v1
-version=v1