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

feat(system-update): Allow switching between branches via rebase #91

Merged
merged 3 commits into from
Nov 3, 2023
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
14 changes: 14 additions & 0 deletions files/etc/ublue-update.d/system/00-system-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from subprocess import run
from json import loads, load
from json.decoder import JSONDecodeError
from pathlib import Path

import os


Expand All @@ -22,6 +24,18 @@ def check_for_rebase():
print("uBlue image info file does not exist")
return False, ""

# Branch away from the default tag when one is set
branch_file = Path("/var/ublue-update/branch")
if branch_file.exists():
with branch_file.open() as f:
branch = f.readline()
branch_file.unlink()
if branch:
return (
True,
f"{default_image_ref[0]}:{default_image_ref[1]}:{default_image_ref[2]}:{branch}",
)

status_cmd = [
"rpm-ostree",
"status",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ install_requires =

[flake8]
max-line-length = 90
ignore = E501
ignore = E501,W503,W504