[+] up to date check
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
include ocpm/*
|
include ocpm/data/*
|
||||||
|
|||||||
+12
-3
@@ -140,14 +140,19 @@ def download_updates(efi: Path, updates: list[tuple[Kext, Release]]):
|
|||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
parser = argparse.ArgumentParser(description='OpenCore Kext Updater by HyDEV')
|
parser = argparse.ArgumentParser(description='OpenCore Package Manager by HyDEV')
|
||||||
parser.add_argument('efi_path', help='EFI Directory Path')
|
parser.add_argument('efi_path', help='EFI Directory Path')
|
||||||
|
parser.add_argument('cmd', help='Command (update)')
|
||||||
parser.add_argument('--pre', action='store_true', help='Use pre-release')
|
parser.add_argument('--pre', action='store_true', help='Use pre-release')
|
||||||
parser.add_argument('-y', action='store_true', help='Say yes')
|
parser.add_argument('-y', action='store_true', help='Say yes')
|
||||||
|
|
||||||
printc('\n&fOpenCore Kext Updater v1.0.0 by HyDEV\n')
|
printc('\n&fOpenCore Package Manager v1.0.0 by HyDEV\n')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.cmd.lower() != 'update':
|
||||||
|
print(f'Unknown Command: {args.cmd}')
|
||||||
|
return
|
||||||
|
|
||||||
# Normalize EFI Path
|
# Normalize EFI Path
|
||||||
efi = Path(args.efi_path)
|
efi = Path(args.efi_path)
|
||||||
if (efi / 'EFI').is_dir():
|
if (efi / 'EFI').is_dir():
|
||||||
@@ -164,7 +169,7 @@ def run():
|
|||||||
# print_kexts(kexts)
|
# print_kexts(kexts)
|
||||||
|
|
||||||
# Read Repo
|
# Read Repo
|
||||||
with open(Path(__file__).parent / 'OCKextRepos.yml') as f:
|
with open(Path(__file__).parent / 'data' / 'OCKextRepos.yml') as f:
|
||||||
repos = ruamel.yaml.safe_load(f)
|
repos = ruamel.yaml.safe_load(f)
|
||||||
|
|
||||||
# Get latest repos with multithreading
|
# Get latest repos with multithreading
|
||||||
@@ -180,6 +185,10 @@ def run():
|
|||||||
updates: list[tuple[Kext, Release]]
|
updates: list[tuple[Kext, Release]]
|
||||||
updates = [(k, l) for k, l in zip(kexts, latests) if l and version.parse(l.tag) > version.parse(k.version)]
|
updates = [(k, l) for k, l in zip(kexts, latests) if l and version.parse(l.tag) > version.parse(k.version)]
|
||||||
|
|
||||||
|
if len(updates) == 0:
|
||||||
|
print(f'✨ Everything up-to-date!')
|
||||||
|
exit(0)
|
||||||
|
|
||||||
# Print updates
|
# Print updates
|
||||||
printc(f'\n✨ Found {len(updates)} Updates:')
|
printc(f'\n✨ Found {len(updates)} Updates:')
|
||||||
print_updates(updates)
|
print_updates(updates)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ setup(
|
|||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
],
|
],
|
||||||
packages=['ocpm'],
|
packages=['ocpm'],
|
||||||
package_data={'ocpm': ['ocpm/*']},
|
package_data={'ocpm': ['ocpm/data/*']},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=['setuptools', 'hypy_utils', 'ruamel.yaml', 'requests', 'tqdm',
|
install_requires=['setuptools', 'hypy_utils', 'ruamel.yaml', 'requests', 'tqdm',
|
||||||
'packaging'],
|
'packaging'],
|
||||||
|
|||||||
Reference in New Issue
Block a user