Fixed md5 validation

This commit is contained in:
NoHomoBoi 2020-08-11 19:44:11 -05:00
parent c9fe88e193
commit b2025d9532
1 changed files with 1 additions and 2 deletions

View File

@ -30,8 +30,7 @@ with open(sys.argv[1], 'r') as f:
for (fname, aname) in lst: for (fname, aname) in lst:
path = os.path.join(sys.argv[2], aname) path = os.path.join(sys.argv[2], aname)
old_md5 = md5(fname); old_md5 = md5(fname);
new_md5 = md5(path); if not os.path.exists(path) or os.path.exists(path) and old_md5 != md5(path):
if not os.path.exists(path) or old_md5 != new_md5:
os.makedirs(os.path.dirname(path), exist_ok=True) os.makedirs(os.path.dirname(path), exist_ok=True)
copyfile(fname, path) copyfile(fname, path)
print("Copying: " + path) print("Copying: " + path)