Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(just): make toggle-updates check if ublue-update is installed #284

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions build/ublue-os-just/10-update.just
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ toggle-updates ACTION="prompt":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
CURRENT_STATE="Disabled"
if systemctl is-enabled ublue-update.timer | grep -q enabled; then
if systemctl -q is-enabled ublue-update.timer; then
CURRENT_STATE="Enabled"
elif systemctl -q is-enabled rpm-ostreed-automatic.timer; then
CURRENT_STATE="Enabled"
fi
OPTION={{ ACTION }}
Expand All @@ -104,15 +106,19 @@ toggle-updates ACTION="prompt":
exit 0
fi
if [ "${OPTION,,}" == "enable" ]; then
sudo systemctl enable ublue-update.timer
if systemctl is-enabled flatpak-system-update.timer | grep -q disabled; then
if systemctl is-enabled ublue-update.timer 2> /dev/null | grep -q not-found; then
sudo systemctl enable --now flatpak-system-update.timer rpm-ostreed-automatic.timer
systemctl enable --now --user flatpak-user-update.timer
else
sudo systemctl enable ublue-update.timer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ublue update is not required to be installed

Its only on Bazzite/bluefin/Aurora.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ublue update is not required to be installed

Its only on Bazzite/bluefin/Aurora.

i left it in there because people can still end up installing ublue-update on an image they built from main so it just adapts to that, i know blue-build has ublue-update as a module, so i figured it would just cover for both (since the old code already assumed ublue-update was present by error)

sudo systemctl disable --now flatpak-system-update.timer rpm-ostreed-automatic.timer
systemctl disable --now --user flatpak-user-update.timer
fi
elif [ "${OPTION,,}" == "disable" ]; then
sudo systemctl disable ublue-update.timer
if systemctl is-enabled flatpak-system-update.timer | grep -q enabled; then
if systemctl is-enabled ublue-update.timer 2> /dev/null | grep -q not-found; then
sudo systemctl disable --now flatpak-system-update.timer rpm-ostreed-automatic.timer
systemctl disable --now --user flatpak-user-update.timer
else
sudo systemctl disable ublue-update.timer
fi
fi
5 changes: 4 additions & 1 deletion build/ublue-os-just/ublue-os-just.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: ublue-os-just
Packager: ublue-os
Vendor: ublue-os
Version: 0.34
Version: 0.35
Release: 1%{?dist}
Summary: ublue-os just integration
License: MIT
Expand Down Expand Up @@ -109,6 +109,9 @@ just --completions bash | sed -E 's/([\(_" ])just/\1ujust/g' > %{_datadir}/bash-
chmod 644 %{_datadir}/bash-completion/completions/ujust

%changelog
* Fri May 31 2024 HikariKnight <[email protected]> - 0.35
- Make toggle-updates smarter and detect if ublue-update is installed

* Sat May 18 2024 m2Giles <[email protected]> - 0.34
- Fix missing sourcefile for just split out

Expand Down
Loading