view sfv.py @ 38:310a73329fa4

Update updatechromium.py unnecessary because pacman does that by itself committer: GitHub <noreply@github.com>
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Mon, 21 Jun 2021 10:26:44 -0400
parents 349c9636d8ca
children 2aa9614cb39a
line wrap: on
line source

import os, sys, zlib

def crc(filename): return "%X"%(zlib.crc32(open(filename,"rb").read()) & 0xFFFFFFFF)

try:
    temp = sys.argv[1]
except:
    print("No file specified!")
    sys.exit()

f = open(sys.argv[1])
lines = f.readlines()
f.close()

for line in lines:
    if not line[0] == ";":
        crc32 = line.strip()[-8:]
        name = line.strip()[:-8]
        if crc(name).zfill(8) == crc32:
            print(f"{name}: CRC hash match!")
        else:
            print(f"{name}: CRC hash does not match!")