fix(just): correctly detect if virt-manager is installed (#1278)

This commit is contained in:
HikariKnight 2024-06-25 01:49:26 +02:00 committed by GitHub
parent cf8b8818dd
commit 289b63f5fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,9 +41,7 @@ setup-virtualization ACTION="":
)
fi
if [[ "${OPTION,,}" =~ (^enable[[:space:]]virtualization|virt-on) ]]; then
(
virt_test=$(rpm-ostree status -v --jsonpath '.deployments[0].packages')
if [[ ${virt_test} == *virt-manager* ]]; then
if rpm -q virt-manager | grep -P "^virt-manager-" 1>/dev/null; then
echo "Installing QEMU and virt-manager..."
rpm-ostree install -y virt-manager edk2-ovmf qemu
rpm-ostree kargs \
@ -53,7 +51,6 @@ setup-virtualization ACTION="":
&& echo "libvirtd will be enabled at next reboot"
echo 'Please reboot to apply changes'
fi
)
elif [[ "${OPTION,,}" =~ (^disable[[:space:]]virtualization|virt-off) ]]; then
if [ "$(systemctl is-enabled libvirtd.service)" == "enabled" ]; then
echo "${red}Disabling${n} libvirtd before removal"