diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-02-20 18:42:15 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-02-24 17:21:09 +0000 |
commit | dbc9c1ca3b909ab990b705ad83ddc81344077117 (patch) | |
tree | c3b522c24c07a86b58a25d789c371ed7c16d219d /baserock-system-config-sync | |
parent | ce2edcba92731c0a83fe59133b64d67afc59212a (diff) | |
download | tbdiff-dbc9c1ca3b909ab990b705ad83ddc81344077117.tar.gz |
Modify 'baserock-system-config-sync' to get two arguments using 'merge'baserock/pedroalvarez/system-version-manager3
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-x | baserock-system-config-sync/baserock-system-config-sync | 11 |
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 29cfdcf..c9d5943 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 } @@ -177,18 +177,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" |