mirror of
https://github.com/sudoxnym/fdroiddata.git
synced 2026-04-15 20:17:42 +00:00
34 lines
761 B
Python
Executable file
34 lines
761 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import glob
|
|
import hashlib
|
|
import inspect
|
|
import os
|
|
import sys
|
|
|
|
|
|
def generate_keyalias(s):
|
|
m = hashlib.md5()
|
|
m.update(s.encode())
|
|
return m.hexdigest()[:8]
|
|
|
|
|
|
base = os.path.realpath(
|
|
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..')
|
|
)
|
|
metadata_files = sorted(
|
|
glob.glob(base + '/metadata/*.txt') + glob.glob(base + '/metadata/*.yml')
|
|
)
|
|
|
|
if not metadata_files:
|
|
print('No metadata files found!')
|
|
sys.exit(1)
|
|
|
|
keyaliases = dict()
|
|
for f in metadata_files:
|
|
appid = os.path.basename(f)[:-4]
|
|
keyalias = generate_keyalias(appid)
|
|
if keyalias in keyaliases:
|
|
print(appid, "keyalias conflicts with", keyaliases[keyalias])
|
|
sys.exit(1)
|
|
keyaliases[keyalias] = appid
|