Skip to content

Commit

Permalink
fix: skip topgrade breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gerblesh committed Sep 2, 2024
1 parent dce31e5 commit 549ebc7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/ublue_update/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ublue_update.update_inhibitors.hardware import check_hardware_inhibitors
from ublue_update.update_inhibitors.custom import check_custom_inhibitors
from ublue_update.config import cfg
from ublue_update.session import get_xdg_runtime_dir, get_active_sessions
from ublue_update.session import get_active_sessions
from ublue_update.filelock import acquire_lock, release_lock


Expand All @@ -37,17 +37,14 @@ def notify(title: str, body: str, actions: list = [], urgency: str = "normal"):
except KeyError as e:
log.error("failed to get active logind session info", e)
for user in users:
try:
xdg_runtime_dir = get_xdg_runtime_dir(user["User"])
except KeyError as e:
log.error(f"failed to get xdg_runtime_dir for user: {user['Name']}", e)
return
user_args = [
"/usr/bin/sudo",
"-u",
f"{user['Name']}",
"DISPLAY=:0",
f"DBUS_SESSION_BUS_ADDRESS=unix:path={xdg_runtime_dir}/bus",
"/usr/bin/systemd-run",
"--user",
"--machine",
f"{user['Name']}@",
"--unit"
f"ublue-update-notify-{user['Name']}"
"--wait"
]
user_args += args
out = subprocess.run(user_args, capture_output=True)
Expand Down Expand Up @@ -121,6 +118,7 @@ def run_updates(system, system_update_available):
"""System"""
out = subprocess.run(
[
"TOPGRADE_SKIP_BRKC_NOTIFY=true"
"/usr/bin/topgrade",
"--config",
"/usr/share/ublue-update/topgrade-system.toml",
Expand All @@ -145,12 +143,14 @@ def run_updates(system, system_update_available):

out = subprocess.run(
[
"/usr/bin/sudo",
"-u",
f"{user['Name']}",
"DISPLAY=:0",
f"XDG_RUNTIME_DIR={xdg_runtime_dir}",
f"DBUS_SESSION_BUS_ADDRESS=unix:path={xdg_runtime_dir}/bus",
"/usr/bin/systemd-run",
"--setenv=TOPGRADE_SKIP_BRKC_NOTIFY=true"
"--user",
"--machine",
f"{user['Name']}@",
"--unit",
f"ublue-update-user-{user['Name']}",
"--wait",
"/usr/bin/topgrade",
"--config",
"/usr/share/ublue-update/topgrade-user.toml",
Expand Down

0 comments on commit 549ebc7

Please sign in to comment.