summaryrefslogtreecommitdiff
path: root/baserock-system-config-sync
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-02-20 18:42:15 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-03-04 17:29:25 +0000
commit308f77a277c3129b9eac6f1e4e72aca9ed78b022 (patch)
tree44818652843acc0b79a6d2d6f2c11a0a8901b4f1 /baserock-system-config-sync
parent0578cae3dfab3ff70a7c8f7028843cfd4b1592b8 (diff)
downloadtbdiff-308f77a277c3129b9eac6f1e4e72aca9ed78b022.tar.gz
Modify 'baserock-system-config-sync' to get two arguments using 'merge'
Since with 'system-version-manager' is possible to change the default system, 'baserock-system-config-sync' shouldn't get the default system, and get an extra parameter to choose the system version to merge.
Diffstat (limited to 'baserock-system-config-sync')
-rwxr-xr-xbaserock-system-config-sync/baserock-system-config-sync11
1 files changed, 6 insertions, 5 deletions
diff --git a/baserock-system-config-sync/baserock-system-config-sync b/baserock-system-config-sync/baserock-system-config-sync
index 4631ad4..e4b4e10 100755
--- a/baserock-system-config-sync/baserock-system-config-sync
+++ b/baserock-system-config-sync/baserock-system-config-sync
@@ -23,7 +23,7 @@ set -eu
usage() {
- echo "Usage: $(basename $0) merge NEW_VERSION_LABEL" >&2
+ echo "Usage: $(basename $0) merge OLD_VERSION_LABEL NEW_VERSION_LABEL" >&2
echo " $(basename $0) sync CANONICAL_VERSION_LABEL" >&2
exit 1
}
@@ -187,18 +187,19 @@ fi
if [ "$1" = "merge" ]; then
- if [ "$#" != 2 ]; then
+ if [ "$#" != 3 ]; then
usage "$0"
fi
- new_version="$2"
+ old_version="$2"
+ new_version="$3"
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
- v1_dir="$mounting_point/systems/default/orig/etc"
- vu_dir="$mounting_point/systems/default/run/etc"
+ v1_dir="$mounting_point/systems/$old_version/orig/etc"
+ vu_dir="$mounting_point/systems/$old_version/run/etc"
v2_dir="$mounting_point/systems/$new_version/run/etc"
vt_dir="$mounting_point/systems/$new_version/run/etc.new"
mkdir "$vt_dir"