Skip to content

Commit

Permalink
feat(system-update): Allow switching between branches via rebase (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo authored Nov 3, 2023
2 parents 4310859 + 0ce9e37 commit e013061
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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

0 comments on commit e013061

Please sign in to comment.