From e8f49b7e5fcf288d8c9256b1626c5b703a97f866 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 16 Feb 2023 13:17:06 -0500 Subject: Fix check_updates Make work with new pack-lock.ini instead of old version.txt --- modpackman.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modpackman.py') diff --git a/modpackman.py b/modpackman.py index e5e5fdc..802ba7a 100755 --- a/modpackman.py +++ b/modpackman.py @@ -111,9 +111,12 @@ def apply_updates(): def check_updates(mods, version_file, version=(2, 0, 0)): pack_version = util.get_version_from_file(version_file) print("Checking for updates to version " + str(pack_version) + "...") + pack_lock = RawConfigParser() + pack_lock.read('pack-lock.ini') latest = [(k, mods[k]) for k in mods.keys()] - old = util.read_file(version_file) - old_urls = [mod[2] for mod in old] + old_urls = [] + for mod in pack_lock['mod_versions'].keys(): + old_urls.append(pack_lock['mod_versions'][mod].split(',')[1]) num_updates = 0 print("Checking updates...") @@ -164,7 +167,7 @@ if __name__ == "__main__": elif args.command == "apply_updates": apply_updates() elif args.command == "check_updates": - check_updates(config['mods'], "version.txt", config['pack']["game_version"]) + check_updates(config['mods'], "pack-lock.ini", config['pack']["game_version"]) else: print("Error: command \"" + args.command + "\" does not exist") parser.print_help() -- cgit v1.2.3