summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbaserock-system-config-sync/baserock-system-config-sync11
-rwxr-xr-xsystem-version-manager/system-version-manager3
-rwxr-xr-xtests/run_tests.sh4
3 files changed, 10 insertions, 8 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"
diff --git a/system-version-manager/system-version-manager b/system-version-manager/system-version-manager
index e553562..370e141 100755
--- a/system-version-manager/system-version-manager
+++ b/system-version-manager/system-version-manager
@@ -127,7 +127,8 @@ class SystemVersionManager(object):
with open(log, 'w') as f:
subprocess.check_call(
- ['baserock-system-config-sync', 'merge', label],
+ ['baserock-system-config-sync',
+ 'merge', self.current_system, label],
stdout=f)
self.status(msg="Installing the kernel")
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 36dff01..a2c8d76 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -56,7 +56,7 @@ for folder in "$merge_pass_folder/"*.in; do
TMPDIR=$(mktemp -d)
TMPDIR=$TMPDIR mounting_script="./fake_mounting_script.sh" unmount=true \
mounting_script_test_dir="$folder" "$bscs_script" "merge" \
- "version2" &>> "$bscs_log"
+ "default" "version2"&>> "$bscs_log"
exit_code="$?"
if [ "$exit_code" -ne 0 ]; then
echo ": FAILED (exit code "$exit_code")" 1>&2
@@ -78,7 +78,7 @@ for folder in "$merge_fail_folder/"*.in; do
TMPDIR=$(mktemp -d)
TMPDIR=$TMPDIR mounting_script="./fake_mounting_script.sh" unmount=true \
mounting_script_test_dir="$folder" "$bscs_script" "merge" \
- "version2" &>> "$bscs_log"
+ "default" "version2"&>> "$bscs_log"
if [ $? -eq 0 ]; then
echo ": FAILED" 1>&2
exit 1