From 82eb117f8b856b5531800850ca125594dfb2b5e3 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Fri, 3 May 2024 11:49:33 -0700 Subject: [PATCH] chore: Adjust LACT updater --- .../shared/usr/libexec/topgrade/lact-update | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/system_files/desktop/shared/usr/libexec/topgrade/lact-update b/system_files/desktop/shared/usr/libexec/topgrade/lact-update index 41477446..76b9de6a 100755 --- a/system_files/desktop/shared/usr/libexec/topgrade/lact-update +++ b/system_files/desktop/shared/usr/libexec/topgrade/lact-update @@ -1,6 +1,9 @@ #!/usr/bin/bash shopt -s nullglob +IMAGE_INFO="/usr/share/ublue-os/image-info.json" +BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO) + echo "Looking for updates..." if [[ $(rpm -qa | grep lact) ]]; then @@ -8,8 +11,22 @@ if [[ $(rpm -qa | grep lact) ]]; then if [[ ! $(rpm-ostree status | grep lact | grep $LACT_VERSION) ]]; then # This will check if *any* rpm-ostree pin has the newest version, so we don't update needlessly if a user just needs to reboot or is trying an older pin. echo "Found upstream version v$LACT_VERSION, updating..." - rpm-ostree remove $(rpm -qa | grep lact) -y - /usr/bin/ujust install-lact + ublue-update --wait + rpm-ostree remove -y $(rpm -qa | grep lact) + if [[ ${BASE_IMAGE_NAME} == 'silverblue' ]]; then + echo 'Installing LACT Libadwaita...' + wget \ + $(curl -s https://api.github.com/repos/ilya-zlobintsev/LACT/releases/latest | \ + jq -r ".assets[] | select(.name | test(\"lact-libadwaita.*fedora-$(rpm -E %fedora)\")) | .browser_download_url") \ + -O /tmp/lact.rpm + else + echo 'Installing LACT...' + wget \ + $(curl -s https://api.github.com/repos/ilya-zlobintsev/LACT/releases/latest | \ + jq -r ".assets[] | select(.name | test(\"lact-[0-9].*fedora-$(rpm -E %fedora)\")) | .browser_download_url") \ + -O /tmp/lact.rpm + fi + rpm-ostree install -y /tmp/lact.rpm echo "Update complete" fi else