diff --git a/MANIFEST.in b/MANIFEST.in index ad329ec..e2df700 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include ocpm/* +include ocpm/data/* diff --git a/ocpm/OCKextRepos.yml b/ocpm/data/OCKextRepos.yml similarity index 100% rename from ocpm/OCKextRepos.yml rename to ocpm/data/OCKextRepos.yml diff --git a/ocpm/main.py b/ocpm/main.py index ed5f912..550e489 100755 --- a/ocpm/main.py +++ b/ocpm/main.py @@ -140,14 +140,19 @@ def download_updates(efi: Path, updates: list[tuple[Kext, Release]]): 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('cmd', help='Command (update)') parser.add_argument('--pre', action='store_true', help='Use pre-release') 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() + if args.cmd.lower() != 'update': + print(f'Unknown Command: {args.cmd}') + return + # Normalize EFI Path efi = Path(args.efi_path) if (efi / 'EFI').is_dir(): @@ -164,7 +169,7 @@ def run(): # print_kexts(kexts) # 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) # Get latest repos with multithreading @@ -180,6 +185,10 @@ def run(): 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)] + if len(updates) == 0: + print(f'✨ Everything up-to-date!') + exit(0) + # Print updates printc(f'\n✨ Found {len(updates)} Updates:') print_updates(updates) diff --git a/setup.py b/setup.py index 44115a6..faf8e69 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( "Programming Language :: Python :: 3.10", ], packages=['ocpm'], - package_data={'ocpm': ['ocpm/*']}, + package_data={'ocpm': ['ocpm/data/*']}, include_package_data=True, install_requires=['setuptools', 'hypy_utils', 'ruamel.yaml', 'requests', 'tqdm', 'packaging'],