update readme output, fix ok packages crashing

This commit is contained in:
Felix Pankratz 2023-07-02 16:11:46 +02:00
parent c64e239dd2
commit 33c9cdec7e
2 changed files with 8 additions and 5 deletions

View File

@ -20,12 +20,11 @@ Version mismatch for darcyclarke-manifest-pkg!
Reported version: 2.1.15
Actual version: 3.0.0
Dependency mismatch detected for darcyclarke-manifest-pkg!
Reported dependencies: {}
Actual dependencies: {'sleepover': '*'}
{'dictionary_item_added': {"root['sleepover']": '*'}}
Scripts mismatch detected for darcyclarke-manifest-pkg!
Reported scripts: {}
Actual scripts: {'install': 'touch ./bad-pkg-write && echo "bad pkg exec!"\n'}
Name mismatch detected for darcyclarke-manifest-pkg!
{ 'dictionary_item_added': { "root['install']": 'touch ./bad-pkg-write && echo '
'"bad pkg exec!"\n'}}
Name mismatch detected for Package(name='darcyclarke-manifest-pkg', reported_manifest=Manifest(name='darcyclarke-manifest-pkg', version='2.1.15', dependencies={}, scripts={}), actual_manifest=Manifest(name='express', version='3.0.0', dependencies={'sleepover': '*'}, scripts={'install': 'touch ./bad-pkg-write && echo "bad pkg exec!"\n'}))!
Reported name: darcyclarke-manifest-pkg
Actual name: express
```

View File

@ -94,6 +94,7 @@ def parse_actual_manifest(pkg, ver):
return Manifest(name, version, dependencies, scripts)
def compare_manifests(pkg):
mismatch = False
if pkg.reported_manifest.version != pkg.actual_manifest.version:
mismatch = True
print('Version mismatch for {}!'.format(pkg.name))
@ -120,6 +121,9 @@ def compare_manifests(pkg):
print('Reported name: {}'.format(pkg.reported_manifest.name))
print('Actual name: {}'.format(pkg.actual_manifest.name))
if not mismatch:
print('No mismatch detected for {}.'.format(pkg.name))
return mismatch