From 1047840cf81a0e70717ab244de728c236ceb6ee5 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Thu, 16 Feb 2023 23:00:19 -0600 Subject: [PATCH 1/2] utils: always check some dependencies. Every dependency in check_deps is used inside the script (apart from git, which may be a historical artifact), and therefore should be checked even when the -f option is passed to the script. Simply changed at what point check_deps is called in order to always run it. Fixes #6302. Signed-off-by: Gabe Venberg --- utils/kata-manager.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 1cb65145fb..d09a2e67b4 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -327,7 +327,7 @@ check_deps() debian|ubuntu) sudo apt-get -y install $packages ;; fedora) sudo dnf -y install $packages ;; opensuse*|sles) sudo zypper install -y $packages ;; - *) die "Unsupported distro: $ID" + *) die "Unsupported distro: $ID, install $packages manually and re-run" esac } @@ -343,10 +343,12 @@ setup() source /etc/os-release || source /usr/lib/os-release + #these dependencies are needed inside this script, and should be checked regardless of the -f option. + check_deps + [ "$force" = "true" ] && return 0 pre_checks - check_deps } # Download the requested version of the specified project. From 3cfce5a7090f5a420def80e58fc7072e4f3cb90a Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Fri, 17 Feb 2023 09:06:26 -0600 Subject: [PATCH 2/2] utils: improved unsupported distro message. previously, if installing on unkown distro, script would tell user that their distro was unsupported. Changed error message prompting user to install dependecies manually, then retry. Signed-off-by: Gabe Venberg --- utils/kata-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index d09a2e67b4..e28c4a44bd 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -327,7 +327,7 @@ check_deps() debian|ubuntu) sudo apt-get -y install $packages ;; fedora) sudo dnf -y install $packages ;; opensuse*|sles) sudo zypper install -y $packages ;; - *) die "Unsupported distro: $ID, install $packages manually and re-run" + *) die "Cannot automatically install packages on $ID, install $packages manually and re-run" esac }