diff --git a/tarball_multi_releases.bash b/tarball_multi_releases.bash index 3855c39..974112f 100755 --- a/tarball_multi_releases.bash +++ b/tarball_multi_releases.bash @@ -86,7 +86,7 @@ main() ) # Delete everything else - rm -r "${archive_name:?}"/* "${archive_name:?}"/.github + rm -rf "${archive_name:?}"/* "${archive_name:?}"/.github # Move the selected things back in place (set -x; mv _selected_versions/* "$archive_name"/ ) @@ -121,6 +121,8 @@ main() radix=${d%-WIP} ( set -x; mv "$d" "${radix}-$last_ver") done + # for install.sh convenience + touch "$last_ver" ) local manifest_file="$archive_name"/manifest.txt diff --git a/tests/tests.bats b/tests/tests.bats index bee7393..091bb60 100644 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -37,6 +37,14 @@ teardown() test_tarball_one_version v1.8.x v1.8 v1.8 } +@test "tarball_multi_releases single 2.1.1" { + test_tarball_multi_single v2.1.x v2.1.1 +} + +@test "tarball_multi_releases single 1.8" { + test_tarball_multi_single v1.8.x v1.8 +} + @test "tarball_topologies_only 2.2.1" { local ver=v2.2.1 test_init @@ -61,8 +69,7 @@ teardown() } @test "tarball_multi_2_1_1a" { - pushd "$RUN_DIR"/ || exit 1 - load 'common_helpers.bash'; set_constants + test_init "$TOP_DIR"/tarball_multi_releases.bash \ v2.2.x/sof-v2.2 v1.8.x/sof-v1.8-rc2 v1.9.x/tools-v1.9-rc1/ \ @@ -74,6 +81,7 @@ teardown() popd || exit 1 } +# You MUST call popd at the end test_init() { pushd "$RUN_DIR"/ || exit 1 @@ -95,6 +103,27 @@ test_tarball_one_version() popd || exit 1 } +# Test the ability of the newer "multi" script to recreate older, single +# version releases that were created with the older +# tarball_one_version.sh +test_tarball_multi_single() +{ + local vdir="$1" + local ver="$2" + test_init + get_release "$ver"/sof-bin-"$ver".tar.gz + + "$TOP_DIR"/tarball_multi_releases.bash -g "$ver" \ + "$vdir"/sof-"$ver" "$vdir"/sof-tplg-"$ver" "$vdir"/tools-"$ver" + tar xf sof-bin-"$ver".tar.gz + + # Cheat a little bit; these files are brand new. + rm sof-bin-"$ver"/manifest.txt sof-bin-"$ver"/sha256sum.txt + + diff -qr "$EXTR_REFS"/sof-bin-"$ver" sof-bin-"$ver" + popd || exit 1 +} + test_tarball_topologies_only() { local dir="$1" ver="$2"