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-03-06 15:34:13 +0000 |
commit | 2c6259f156087e2b99d02666c5323d598aca9f45 (patch) | |
tree | 921cfda7f7a6c42c9321718031f339faf16f76c8 /baserock-system-config-sync | |
parent | d8532bc2f93a80b5be8701955e668787be41ac3e (diff) | |
download | tbdiff-2c6259f156087e2b99d02666c5323d598aca9f45.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 f21f898..7321a1b 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" |