mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 21:12:04 -08:00
Add "Create new patch" to dev UI
This commit is contained in:
parent
c9ee89f4a4
commit
a96fed208d
1 changed files with 19 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ def into_camoufox_dir():
|
||||||
os.chdir(os.path.dirname(this_script))
|
os.chdir(os.path.dirname(this_script))
|
||||||
os.chdir(find_src_dir('.'))
|
os.chdir(find_src_dir('.'))
|
||||||
|
|
||||||
|
|
||||||
def reset_camoufox():
|
def reset_camoufox():
|
||||||
"""Reset the Camoufox source"""
|
"""Reset the Camoufox source"""
|
||||||
with temp_cd('..'):
|
with temp_cd('..'):
|
||||||
|
|
@ -141,6 +142,7 @@ def get_rejects(patch_file):
|
||||||
choices = [
|
choices = [
|
||||||
"Reset workspace",
|
"Reset workspace",
|
||||||
"Edit a patch",
|
"Edit a patch",
|
||||||
|
"Create new patch",
|
||||||
"\u2014" * 44,
|
"\u2014" * 44,
|
||||||
"List patches currently applied",
|
"List patches currently applied",
|
||||||
"Select patches",
|
"Select patches",
|
||||||
|
|
@ -167,11 +169,27 @@ def handle_choice(choice):
|
||||||
"Reset Complete",
|
"Reset Complete",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
case "Create new patch":
|
||||||
|
# Reset camoufox, apply all patches, then create a checkpoint
|
||||||
|
with temp_cd('..'):
|
||||||
|
run('make dir')
|
||||||
|
run('make checkpoint')
|
||||||
|
easygui.msgbox(
|
||||||
|
"Created new patch workspace. You can test Camoufox with 'make run'.\n\n"
|
||||||
|
"When you are finished, write your workspace back to a new patch.",
|
||||||
|
"New Patch Workspace",
|
||||||
|
)
|
||||||
|
|
||||||
case "List patches currently applied":
|
case "List patches currently applied":
|
||||||
# Produces a list of patches that are applied
|
# Produces a list of patches that are applied
|
||||||
apply_dict = {}
|
apply_dict = {}
|
||||||
for patch_file in list_patches():
|
for patch_file in list_patches():
|
||||||
print(f'FILE: {patch_file}')
|
print(f'FILE: {patch_file}')
|
||||||
|
# Ignore bootstrap files, these will always break.
|
||||||
|
if os.path.basename(patch_file).startswith('0-'):
|
||||||
|
apply_dict[patch_file] = 'IGNORED'
|
||||||
|
continue
|
||||||
|
# Check if the patch can be applied or reversed
|
||||||
can_apply, can_reverse, broken = check_patch(patch_file)
|
can_apply, can_reverse, broken = check_patch(patch_file)
|
||||||
if broken:
|
if broken:
|
||||||
apply_dict[patch_file] = 'BROKEN'
|
apply_dict[patch_file] = 'BROKEN'
|
||||||
|
|
@ -218,7 +236,7 @@ def handle_choice(choice):
|
||||||
broken_patches.append((patch_file, reject_files))
|
broken_patches.append((patch_file, reject_files))
|
||||||
|
|
||||||
if not broken_patches:
|
if not broken_patches:
|
||||||
easygui.msgbox("All patches applied successfully", "Patching Result")
|
easygui.msgbox("All patches applied successfully.", "Patching Result")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Display message
|
# Display message
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue