From 1bf26901e7b668146eae4f6a94dceb3e9f4b33f1 Mon Sep 17 00:00:00 2001 From: Rodrigo Chiossi Date: Wed, 6 Nov 2019 15:36:49 +0000 Subject: [PATCH] cmd: Remove all uses of deprecated flag --native Delete all instances of --native from the code. Signed-off-by: Rodrigo Chiossi --- afb.sh | 10 ++--- bat/lib/mixerlib.bash | 40 +++++++++---------- bat/tests/build-all-delta-packs/run.bats | 4 +- bat/tests/build-delta-manifests/run.bats | 4 +- bat/tests/build-validate/run.bats | 20 +++++----- bat/tests/clean-rebuild/run.bats | 4 +- bat/tests/ister-config/run.bats | 2 +- .../manual-upstream-format-bump-flow/run.bats | 4 +- bat/tests/state-conversion/run.bats | 4 +- validate-swupd.sh | 6 +-- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/afb.sh b/afb.sh index 9aaa39a..edcb4e5 100755 --- a/afb.sh +++ b/afb.sh @@ -48,8 +48,8 @@ mixer bundle add os-core os-core-update foo ############################################################################### # build bundles and updates regularly -mixer build bundles --native -mixer build update --native +mixer build bundles +mixer build update ############################################################################### # +10 @@ -66,7 +66,7 @@ mixer build update --native mixer versions update --mix-version 20 # build bundles normally. At this point the bundles to be deleted should still # be part of the mixbundles list and the groups.ini -mixer build bundles --native +mixer build bundles # remove all deleted bundles' content by replacing bundle-info files with empty # directories. This causes mixer to fall back to reading content for those # bundles from a chroot. The chroots for these bundles will be empty. @@ -85,7 +85,7 @@ echo 2 > update/image/20/full/usr/share/defaults/swupd/format # build update based on the modified bundle information. This is *not* a # minversion and these manifests must be built with the mixer from the original # format (if manifest format changes). -mixer build update --native +mixer build update ############################################################################### @@ -115,4 +115,4 @@ done cp -al update/image/20 update/image/30 # build an update as a minversion, this is the first build where the manifests # identify as the new format -mixer build update --native --min-version 30 --skip-format-check +mixer build update --min-version 30 --skip-format-check diff --git a/bat/lib/mixerlib.bash b/bat/lib/mixerlib.bash index b5a31a0..4f6ce27 100755 --- a/bat/lib/mixerlib.bash +++ b/bat/lib/mixerlib.bash @@ -15,74 +15,74 @@ global_setup() { } localize_builder_conf() { - mixer $MIXARGS config set Mixer.LOCAL_RPM_DIR $BATS_TEST_DIRNAME/local-rpms --native=true - mixer $MIXARGS config set Mixer.LOCAL_REPO_DIR $BATS_TEST_DIRNAME/local-yum --native=true + mixer $MIXARGS config set Mixer.LOCAL_RPM_DIR $BATS_TEST_DIRNAME/local-rpms + mixer $MIXARGS config set Mixer.LOCAL_REPO_DIR $BATS_TEST_DIRNAME/local-yum } # Initializes a mix with the desired versions. Then for efficiency converts # builder.conf to use os-core for the "update bundle", strips os-core to just # the filesystem, and adds only os-core to the mix mixer-init-stripped-down() { - mixer $MIXARGS init --clear-version $1 --mix-version $2 --no-default-bundles --native=true + mixer $MIXARGS init --clear-version $1 --mix-version $2 --no-default-bundles sed -i 's/os-core-update/os-core/' $BATS_TEST_DIRNAME/builder.conf echo "filesystem" > $LOCAL_BUNDLE_DIR/os-core - mixer $MIXARGS bundle add os-core --native=true + mixer $MIXARGS bundle add os-core } mixer-versions-update() { - mixer $MIXARGS versions update --mix-version $1 --upstream-version $2 --native=true + mixer $MIXARGS versions update --mix-version $1 --upstream-version $2 } mixer-mixversion-update() { - mixer $MIXARGS versions update --mix-version $1 --native=true + mixer $MIXARGS versions update --mix-version $1 } mixer-upstream-update() { - mixer $MIXARGS versions update --upstream-version $1 --native=true + mixer $MIXARGS versions update --upstream-version $1 } mixer-build-bundles() { - sudo -E mixer $MIXARGS build bundles --config $BATS_TEST_DIRNAME/builder.conf --native=true + sudo -E mixer $MIXARGS build bundles --config $BATS_TEST_DIRNAME/builder.conf } mixer-build-update() { - sudo -E mixer $MIXARGS build update --config $BATS_TEST_DIRNAME/builder.conf --native=true + sudo -E mixer $MIXARGS build update --config $BATS_TEST_DIRNAME/builder.conf } mixer-build-update-minversion() { - sudo -E mixer $MIXARGS build update --config $BATS_TEST_DIRNAME/builder.conf --native=true --min-version $1 + sudo -E mixer $MIXARGS build update --config $BATS_TEST_DIRNAME/builder.conf --min-version $1 } mixer-build-all() { - sudo -E mixer $MIXARGS build all --config $BATS_TEST_DIRNAME/builder.conf --native=true + sudo -E mixer $MIXARGS build all --config $BATS_TEST_DIRNAME/builder.conf } mixer-build-delta-packs() { - sudo -E mixer $MIXARGS build delta-packs --config $BATS_TEST_DIRNAME/builder.conf --native=true --previous-versions $1 + sudo -E mixer $MIXARGS build delta-packs --config $BATS_TEST_DIRNAME/builder.conf --previous-versions $1 } mixer-build-delta-manifests() { - sudo -E mixer $MIXARGS build delta-manifests --config $BATS_TEST_DIRNAME/builder.conf --native=true --previous-versions $1 + sudo -E mixer $MIXARGS build delta-manifests --config $BATS_TEST_DIRNAME/builder.conf --previous-versions $1 } mixer-build-format-bump-new() { - sudo -E mixer $MIXARGS build format-bump new --new-format $1 --native=true + sudo -E mixer $MIXARGS build format-bump new --new-format $1 } mixer-build-format-bump-old() { - sudo -E mixer $MIXARGS build format-bump old --new-format $1 --native=true + sudo -E mixer $MIXARGS build format-bump old --new-format $1 } mixer-build-format-bump() { - sudo -E mixer $MIXARGS build format-bump --new-format $1 --native=true + sudo -E mixer $MIXARGS build format-bump --new-format $1 } mixer-build-upstream-format-bump() { - sudo -E mixer $MIXARGS build upstream-format --new-format $1 --native=true + sudo -E mixer $MIXARGS build upstream-format --new-format $1 } mixer-add-rpms() { mkdir -p $BATS_TEST_DIRNAME/local-yum $BATS_TEST_DIRNAME/local-rpms - sudo -E mixer $MIXARGS add-rpms --config $BATS_TEST_DIRNAME/builder.conf --native=true + sudo -E mixer $MIXARGS add-rpms --config $BATS_TEST_DIRNAME/builder.conf } create-empty-local-bundle() { @@ -98,11 +98,11 @@ remove-package-from-local-bundle() { } mixer-bundle-add() { - mixer $MIXARGS bundle add $1 --native=true + mixer $MIXARGS bundle add $1 } mixer-bundle-remove() { - mixer $MIXARGS bundle remove $1 --native=true + mixer $MIXARGS bundle remove $1 } get-current-version() { diff --git a/bat/tests/build-all-delta-packs/run.bats b/bat/tests/build-all-delta-packs/run.bats index bcf3a2a..42d140d 100755 --- a/bat/tests/build-all-delta-packs/run.bats +++ b/bat/tests/build-all-delta-packs/run.bats @@ -10,9 +10,9 @@ setup() { @test "build delta-packs after build all" { current_ver=$(get-current-version) mixer-init-stripped-down "$current_ver" 10 - sudo -E mixer build all --native --increment + sudo -E mixer build all --increment mixer-build-all - sudo -E mixer build delta-packs --native --previous-versions=1 + sudo -E mixer build delta-packs --previous-versions=1 test $(< mixversion) -eq 20 test -e update/www/20/pack-os-core-from-10.tar diff --git a/bat/tests/build-delta-manifests/run.bats b/bat/tests/build-delta-manifests/run.bats index c7e9649..c192729 100755 --- a/bat/tests/build-delta-manifests/run.bats +++ b/bat/tests/build-delta-manifests/run.bats @@ -10,9 +10,9 @@ setup() { @test "build delta-manifests after build all" { current_ver=$(get-current-version) mixer-init-stripped-down "$current_ver" 10 - sudo -E mixer build all --native --increment + sudo -E mixer build all --increment mixer-build-all - sudo -E mixer build delta-manifests --native --previous-versions=1 + sudo -E mixer build delta-manifests --previous-versions=1 test $(< mixversion) -eq 20 test -e update/www/20/Manifest-os-core-delta-from-10 diff --git a/bat/tests/build-validate/run.bats b/bat/tests/build-validate/run.bats index a6cb776..d4402bb 100755 --- a/bat/tests/build-validate/run.bats +++ b/bat/tests/build-validate/run.bats @@ -30,7 +30,7 @@ setup() { add-package-to-local-bundle "bsdiff" "testbundle1" mixer bundle add testbundle1 - sudo mixer build all --increment --native + sudo mixer build all --increment # Modify testbundle1 add-package-to-local-bundle "helloworld" "testbundle1" @@ -40,17 +40,17 @@ setup() { add-package-to-local-bundle "bsdiff" "testbundle2" mixer bundle add testbundle2 - sudo mixer build all --increment --native + sudo mixer build all --increment # Create format bump - sudo mixer build format-bump --new-format $((format+1)) --native + sudo mixer build format-bump --new-format $((format+1)) # Store a copy of update so that it doesn't need to be regenerated sudo cp -r "${BATS_TEST_DIRNAME}"/update "${BATS_TEST_DIRNAME}"/update-backup } @test "MCA compare manifests with added, modified, and unchanged bundles" { - run sudo sh -c "mixer build validate --from 10 --to 20 --native" + run sudo sh -c "mixer build validate --from 10 --to 20" [[ "$status" -eq 0 ]] @@ -66,7 +66,7 @@ setup() { } @test "MCA compare to +10" { - run sudo mixer build validate --from 20 --to 30 --native + run sudo mixer build validate --from 20 --to 30 [[ "$status" -eq 0 ]] @@ -82,7 +82,7 @@ setup() { } @test "MCA compare +10 to +20" { - run sudo mixer build validate --from 30 --to 40 --native + run sudo mixer build validate --from 30 --to 40 [[ $status -eq 0 ]] @@ -115,7 +115,7 @@ setup() { sudo sed -i "/version$/ s/[a-z0-9]\{64\}/$versionHash/" ${BATS_TEST_DIRNAME}/update/www/20/Manifest.os-core sudo sed -i "/versionstamp$/ s/[a-z0-9]\{64\}/$stampHash/" ${BATS_TEST_DIRNAME}/update/www/20/Manifest.os-core - run sudo mixer build validate --from 10 --to 20 --native + run sudo mixer build validate --from 10 --to 20 [[ $status -ne 0 ]] @@ -133,7 +133,7 @@ setup() { formatHash=$(awk '/swupd\/format$/ {print $2}' "${BATS_TEST_DIRNAME}"/update/www/10/Manifest.os-core-update) sudo sed -i "/swupd\/format$/ s/[a-z0-9]\{64\}/$formatHash/" ${BATS_TEST_DIRNAME}/update/www/30/Manifest.os-core-update - run sudo mixer build validate --from 20 --to 30 --native + run sudo mixer build validate --from 20 --to 30 [[ $status -ne 0 ]] [[ $output =~ "ERROR: /usr/share/defaults/swupd/format is not modified in manifest 'os-core-update'" ]] @@ -144,7 +144,7 @@ setup() { hash1=d93a5e9123361e28b9e244fe422234e3a1794b001a082aeb78e16fd881673a2c sudo sed -i "/os-release$/ s/[a-z0-9]\{64\}/$hash1/" ${BATS_TEST_DIRNAME}/update/www/40/Manifest.os-core - run sudo mixer build validate --from 30 --to 40 --native + run sudo mixer build validate --from 30 --to 40 [[ $status -ne 0 ]] [[ $output =~ "WARNING: If this is a +10 to +20 comparison, os-core/os-core-update have file exception errors" ]] @@ -152,7 +152,7 @@ setup() { @test "MCA override DNF conf to invalid URL" { # Override upstream repo to invalid URL to confirm DNF conf overrides succeed - run sudo sh -c "mixer build validate --from 10 --to 20 --native --from-repo-url clear=foo" + run sudo sh -c "mixer build validate --from 10 --to 20 --from-repo-url clear=foo" [[ "$status" -ne 0 ]] [[ "$output" =~ "RPM download attempt 4 failed. Maximum of 4 attempts." ]] diff --git a/bat/tests/clean-rebuild/run.bats b/bat/tests/clean-rebuild/run.bats index 3b2571c..17c93b1 100755 --- a/bat/tests/clean-rebuild/run.bats +++ b/bat/tests/clean-rebuild/run.bats @@ -14,7 +14,7 @@ setup() { mixer-build-all # Rebuild v20 with --clean - run sudo mixer build all --clean --native + run sudo mixer build all --clean [[ $status -eq 0 ]] mom="$BATS_TEST_DIRNAME"/update/www/20/Manifest.MoM @@ -30,7 +30,7 @@ setup() { # LAST_VER which will lead to an incorrectly generated manifest. sed -i "/PREVIOUS_MIX_VERSION/d" mixer.state - run sudo mixer build all --clean --native + run sudo mixer build all --clean [[ $status -eq 0 ]] # Verify that previous is incorrect diff --git a/bat/tests/ister-config/run.bats b/bat/tests/ister-config/run.bats index 4c87b2c..6718255 100755 --- a/bat/tests/ister-config/run.bats +++ b/bat/tests/ister-config/run.bats @@ -14,7 +14,7 @@ setup() { # `build image` should fail because the prerequisite commands are not executed. # This is intentional in order to reduce test execution time. # The goal is to unit test the creation of ister config file with relevant bundles. - run sudo mixer $MIXARGS build image --native + run sudo mixer $MIXARGS build image [[ "$status" -eq 1 ]] [[ "$output" =~ "release-image-config.json not found" ]] [[ "$output" =~ "Copying image template" ]] diff --git a/bat/tests/manual-upstream-format-bump-flow/run.bats b/bat/tests/manual-upstream-format-bump-flow/run.bats index bfdf7d4..beadca6 100755 --- a/bat/tests/manual-upstream-format-bump-flow/run.bats +++ b/bat/tests/manual-upstream-format-bump-flow/run.bats @@ -90,7 +90,7 @@ setup() { # caused the bundles to be dropped from client systems at that point. for i in $(grep -lir "\[STATUS\]: Deprecated" upstream-bundles/ local-bundles/); do b=$(basename $i) - sudo mixer $MIXARGS bundle remove $b --native=true; sudo sed -i "/\[$b\]/d;/group=$b/d" update/groups.ini; + sudo mixer $MIXARGS bundle remove $b; sudo sed -i "/\[$b\]/d;/group=$b/d" update/groups.ini; done # link the +10 bundles to the +20 so we are building the update with the same # underlying content. The only things that might change are the manifests @@ -99,7 +99,7 @@ setup() { sudo cp -al update/image/20 update/image/30 # build an update as a minversion, this is the first build where the manifests # identify as the new format - sudo -E mixer $MIXARGS build update --config $BATS_TEST_DIRNAME/builder.conf --native=true --min-version 30 --skip-format-check + sudo -E mixer $MIXARGS build update --config $BATS_TEST_DIRNAME/builder.conf --min-version 30 --skip-format-check # validate the +20 build grep -P "MANIFEST\t2" update/www/30/Manifest.MoM diff --git a/bat/tests/state-conversion/run.bats b/bat/tests/state-conversion/run.bats index b233ed4..e08b81a 100755 --- a/bat/tests/state-conversion/run.bats +++ b/bat/tests/state-conversion/run.bats @@ -39,7 +39,7 @@ function copy_test_state() { copy_test_state configs/1.0_mixer.state # Verify that state is converted when LAST_VER doesn't exist - sudo mixer build all --native + sudo mixer build all diff mixer.state current.state # Increment versions and update expected PREVIOUS_MIX_VERSION value @@ -50,7 +50,7 @@ function copy_test_state() { # Verify that state is converted and initialized to LAST_VER. At the # time of the PREVIOUS_MIX_VERSION initialization, LAST_VER should # still be 10. - sudo mixer build all --native + sudo mixer build all diff mixer.state current.state } diff --git a/validate-swupd.sh b/validate-swupd.sh index 663fa65..cef80c3 100755 --- a/validate-swupd.sh +++ b/validate-swupd.sh @@ -57,20 +57,20 @@ for i in $(seq $1 10 $2); do # increase the number of bundle-workers on larger systems # keep in mind that this is network bound due to dnf installs # of upstream tarballs - mixer build bundles --bundle-workers 8 --native + mixer build bundles --bundle-workers 8 if [[ $? -ne 0 ]]; then echo "failed to build mix bundles" exit 1 fi # increase the number of fullfile-workers on larger systems - mixer build update --fullfile-workers 8 --min-version $1 --format $3 --native + mixer build update --fullfile-workers 8 --min-version $1 --format $3 if [[ $? -ne 0 ]]; then echo "failed to build mix update" exit 1 fi # increase the number of delta-workers on larger systems # this is memory-bound instead of cpu-bound - mixer build delta-packs --previous-versions 3 --delta-workers 4 --native + mixer build delta-packs --previous-versions 3 --delta-workers 4 if [[ $? -ne 0 ]]; then echo "failed to build delta packs" exit 1