Implement update shim

This commit is contained in:
Mykola Grymalyuk
2024-05-26 19:21:49 -06:00
parent b6346137f3
commit 7d686a29cf
9 changed files with 111 additions and 7 deletions
+17
View File
@@ -0,0 +1,17 @@
from pathlib import Path
from opencore_legacy_patcher.support import subprocess_wrapper
class GenerateAutoPkg:
def __init__(self) -> None:
self._package_build_bin = "/usr/local/bin/packagesbuild"
self._autopkg_config = "./ci_tooling/autopkg/AutoPkg-Assets-Setup.pkgproj"
def generate(self) -> None:
"""
Generate AutoPkg Assets
"""
print("Generating AutoPkg Assets")
subprocess_wrapper.run_and_verify([self._package_build_bin, self._autopkg_config])
+31
View File
@@ -0,0 +1,31 @@
from pathlib import Path
from opencore_legacy_patcher.support import subprocess_wrapper
class GenerateShim:
def __init__(self) -> None:
self._shim_path = "./ci_tooling/update_shim/OpenCore-Patcher.app"
self._shim_pkg = f"{self._shim_path}/Contents/Resources/OpenCore-Patcher.pkg"
self._build_pkg = "./dist/OpenCore-Patcher.pkg"
self._output_shim = "./dist/OpenCore-Patcher (Shim).app"
def generate(self) -> None:
"""
Generate Update Shim
"""
print("Generating Update Shim")
if Path(self._shim_pkg).exists():
Path(self._shim_pkg).unlink()
subprocess_wrapper.run_and_verify(["/bin/cp", "-R", self._build_pkg, self._shim_pkg])
if Path(self._output_shim).exists():
Path(self._output_shim).unlink()
subprocess_wrapper.run_and_verify(["/bin/cp", "-R", self._shim_path, self._output_shim])