summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2014-01-06 14:34:23 +0000
committerBen Brown <ben.brown@codethink.co.uk>2014-01-06 14:34:23 +0000
commit20e5304f40148d43c6ab57dea0abe400475e7e9f (patch)
treea84386a33748b990a1e9e9e5413a4053019fbc91
parentb3447cb0dccac2227cac8aadce0b6acbf81c1d66 (diff)
parent44c52debfb8bc27a78e4159fff30ac6e716c9518 (diff)
downloadtbdiff-20e5304f40148d43c6ab57dea0abe400475e7e9f.tar.gz
Merge branch 'benbrown/bscs-non-baserock'
-rwxr-xr-xbaserock-system-config-sync/baserock-system-config-sync20
1 files changed, 10 insertions, 10 deletions
diff --git a/baserock-system-config-sync/baserock-system-config-sync b/baserock-system-config-sync/baserock-system-config-sync
index 9b00625..cb5984d 100755
--- a/baserock-system-config-sync/baserock-system-config-sync
+++ b/baserock-system-config-sync/baserock-system-config-sync
@@ -151,12 +151,12 @@ merge_regular_file() {
cp -a "$vu" "$vt"
;;
'none exists exists')
- if ! (diff "$v2" "$vu" | patch "$v2" -t -o "$vt"); then
+ if ! (diff -u "$v2" --label="$v2" "$vu" --label="$vu" | patch "$v2" -t -o "$vt"); then
cp -a "$v2" "$vt" # merge failed, use v2
fi
;;
'exists exists exists')
- if ! (diff "$v1" "$vu" | patch "$v2" -t -o "$vt"); then
+ if ! (diff -u "$v1" --label="$v1" "$vu" --label="$vu" | patch "$v2" -t -o "$vt"); then
cp -a "$v2" "$vt" # merge failed, use v2
fi
;;
@@ -176,17 +176,17 @@ if [ "$1" = "merge" ]; then
if [ "$#" != 2 ]; then
usage "$0"
fi
- local new_version="$2"
- local mounting_point=$(mktemp -d)
+ new_version="$2"
+ mounting_point=$(mktemp -d)
"$mounting_script" "$mounting_point"
if [ ! -d "$mounting_point/systems/$new_version" ]; then
"$unmount" "$mounting_point"
die "Error: version not found - '$new_version'"
fi
- local v1_dir="$mounting_point/systems/default/orig/etc"
- local vu_dir="$mounting_point/systems/default/run/etc"
- local v2_dir="$mounting_point/systems/$new_version/run/etc"
- local vt_dir="$mounting_point/systems/$new_version/run/etc.new"
+ v1_dir="$mounting_point/systems/default/orig/etc"
+ vu_dir="$mounting_point/systems/default/run/etc"
+ v2_dir="$mounting_point/systems/$new_version/run/etc"
+ vt_dir="$mounting_point/systems/$new_version/run/etc.new"
mkdir "$vt_dir"
trap 'rm -rvf "$vt_dir"; "$unmount" "$mounting_point"' EXIT
# For every pathname in V1, Vuser, or V2
@@ -197,8 +197,8 @@ if [ "$1" = "merge" ]; then
rm -rf "$v2_dir"
mv "$vt_dir" "$v2_dir"
elif [ "$1" = "sync" ]; then
- local canonical_version="$2"
- local mounting_point=$(mktemp -d)
+ canonical_version="$2"
+ mounting_point=$(mktemp -d)
"$mounting_script" "$mounting_point"
trap '"$unmount" "$mounting_point"' EXIT
if [ ! -d "$mounting_point/systems/$canonical_version" ]; then