From 73177ca355f5738dc8bdf408a11f4d05df40d9c2 Mon Sep 17 00:00:00 2001 From: Alexander Hayden Date: Sun, 20 Dec 2020 16:30:59 -0500 Subject: add blacklist functionality --- modpackman.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modpackman.py') diff --git a/modpackman.py b/modpackman.py index 18cdecc..69ebe41 100755 --- a/modpackman.py +++ b/modpackman.py @@ -19,6 +19,7 @@ from util import config def install(): mods_location = os.path.join(config["pack"]["location"], "mods") whitelist = config["pack"]["whitelist"] + blacklist = config["pack"]["blacklist"] # Actual download links are stored in pack-lock.ini, so we need to read it in here pack_lock = RawConfigParser() @@ -39,8 +40,9 @@ def install(): checksum, url = entry[1].split(',') mod_path = os.path.join(mods_location, name) i += 1 - if os.path.exists(mod_path) and os.path.isfile(mod_path) and \ - hashlib.sha1(open(mod_path, 'rb').read()).hexdigest() == checksum: + if (os.path.exists(mod_path) and os.path.isfile(mod_path) and \ + hashlib.sha1(open(mod_path, 'rb').read()).hexdigest() == checksum) or \ + name in blacklist: print(f"Skipping {name}, already up to date") else: print(f'Installing {name} from {url}...') -- cgit v1.2.3