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-26 14:23:10 +0000 |
commit | 7ac781919ae61cfc66bc277edaa34749310b3fee (patch) | |
tree | 162ea1116a3be1c12c689f0ccb49a19e1528a6a0 /baserock-system-config-sync | |
parent | 1a50b0ad73c809fd850498fc1a7131559f2f29ec (diff) | |
download | tbdiff-7ac781919ae61cfc66bc277edaa34749310b3fee.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-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 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" |