aboutsummaryrefslogtreecommitdiff
path: root/modpackman.py
diff options
context:
space:
mode:
authorAlexander Hayden <alexhayden25@gmail.com>2020-12-20 16:30:59 -0500
committerAlexander Hayden <alexhayden25@gmail.com>2020-12-20 16:30:59 -0500
commit73177ca355f5738dc8bdf408a11f4d05df40d9c2 (patch)
tree5e581f3a9f76da9b298ab9c3786e2fd044acdc50 /modpackman.py
parent2692a68548b91b6d3b0ff1791cd4074d6b202697 (diff)
downloadmodpackman-73177ca355f5738dc8bdf408a11f4d05df40d9c2.tar.gz
modpackman-73177ca355f5738dc8bdf408a11f4d05df40d9c2.zip
add blacklist functionality
Diffstat (limited to 'modpackman.py')
-rwxr-xr-xmodpackman.py6
1 files changed, 4 insertions, 2 deletions
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}...')