This commit is contained in:
Marc Beninca 2021-10-12 23:03:17 +02:00 committed by Marc Beninca
parent 3f0fa5bbac
commit fb63dc8048
2 changed files with 4 additions and 4 deletions

View file

@ -10,8 +10,6 @@
### Fixes ### Fixes
* [ ] check integrity of packages on a single line
### Tests ### Tests
* [ ] pacman's need of .sig files for packages * [ ] pacman's need of .sig files for packages

View file

@ -29,14 +29,16 @@ def check():
for package in subsystem.catalog.packages.values(): for package in subsystem.catalog.packages.values():
packages.append((subsystem, package)) packages.append((subsystem, package))
for index, items in enumerate(packages): for index, items in enumerate(packages):
print(index, '/', len(packages)) print('\r', index, '/', len(packages), '', 'checked', end='')
subsystem, package = items subsystem, package = items
path = os.path.join(subsystem.path, package.filename) path = os.path.join(subsystem.path, package.filename)
with open(path, 'br') as f: with open(path, 'br') as f:
hash = hashlib.sha256(f.read()).hexdigest() hash = hashlib.sha256(f.read()).hexdigest()
if hash != package.sha256sum: if hash != package.sha256sum:
broken.append(package) broken.append(package)
print(len(broken), '/', len(packages)) print()
print('', str(len(broken)).rjust(len(str(len(packages)))),
'/', len(packages), '', 'broken')
def info(): def info():