check
This commit is contained in:
parent
3f0fa5bbac
commit
fb63dc8048
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||||
|
|
|
@ -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():
|
||||||
|
|
Loading…
Reference in a new issue