From dd615e30e45c5d0db84e6778164e4b99e614a66d Mon Sep 17 00:00:00 2001 From: Grant Orndorff Date: Wed, 21 Feb 2024 17:07:24 -0500 Subject: [PATCH] wip --- .../binary-package-renames-install-upc.sh | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/sru/release-31/binary-package-renames-install-upc.sh b/sru/release-31/binary-package-renames-install-upc.sh index 0f4bfaa7c1..c4aa8c7b58 100755 --- a/sru/release-31/binary-package-renames-install-upc.sh +++ b/sru/release-31/binary-package-renames-install-upc.sh @@ -3,8 +3,10 @@ set -e series=$1 install_from=$2 # 'staging', or 'proposed', or the name of a ppa +version=$3 name=$series-test +specify_proposed="" function cleanup { lxc delete $name --force @@ -24,7 +26,7 @@ sleep 5 # Install latest ubuntu-advantage-tools lxc exec $name -- apt-get update > /dev/null lxc exec $name -- apt-get install -y ubuntu-advantage-tools > /dev/null -echo -e "\n* Latest u-a-t is installed" +echo -e "\n* Latest u-a-t is installed from -updates" echo "###########################################" lxc exec $name -- apt-cache policy ubuntu-advantage-tools echo -e "###########################################\n" @@ -37,6 +39,7 @@ if [ $install_from == 'staging' ]; then elif [ $install_from == 'proposed' ]; then lxc exec $name -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list" lxc exec $name -- apt-get update > /dev/null + specify_proposed="/$series-proposed" else lxc exec $name -- sudo add-apt-repository $install_from -y > /dev/null lxc exec $name -- apt-get update > /dev/null @@ -49,11 +52,20 @@ echo "###########################################" lxc exec $name -- pro attach $UACLIENT_BEHAVE_CONTRACT_TOKEN echo -e "###########################################\n" +echo -e "\n* upgrade to rename" +echo "###########################################" +set -x +# lxc exec $name -- apt install ubuntu-advantage-tools/$series-proposed -y +# lxc exec $name -- apt install ubuntu-pro-client/$series-proposed -y +# lxc exec $name -- apt install ubuntu-pro-client/$series-proposed=$version -y +lxc exec $name -- apt install ubuntu-pro-client${specify_proposed}=$version -y +set +x +echo -e "###########################################\n" -echo -e "\n* installing only ubuntu-pro-client brings ubuntu-advantage-tools too" +echo -e "\n* autoremove just to make sure it doesn't do anything unexpected" echo "###########################################" set -x -lxc exec $name -- apt-get install ubuntu-pro-client -y || true +lxc exec $name -- apt autoremove -y set +x echo -e "###########################################\n" @@ -65,7 +77,26 @@ echo -e "###########################################\n" echo -e "\n* appropriate versions of ubuntu-advantage-tools and ubuntu-pro-client are installed" echo "###########################################" lxc exec $name -- apt policy ubuntu-advantage-tools ubuntu-pro-client -lxc exec $name -- apt show ubuntu-pro-client echo -e "###########################################\n" +if [ "$series" != "xenial" ] && [ "$series" != "bionic" ]; then + echo -e "\n* reinstall just to make sure it doesn't do anything unexpected" + echo "###########################################" + set -x + lxc exec $name -- apt reinstall ubuntu-advantage-tools + lxc exec $name -- apt reinstall ubuntu-pro-client + set +x + echo -e "###########################################\n" + + echo -e "\n* still attached" + echo "###########################################" + lxc exec $name -- pro status + echo -e "###########################################\n" + + echo -e "\n* appropriate versions of ubuntu-advantage-tools and ubuntu-pro-client are installed" + echo "###########################################" + lxc exec $name -- apt policy ubuntu-advantage-tools ubuntu-pro-client + echo -e "###########################################\n" +fi + cleanup