mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Fix issue with check all zip files
This commit is contained in:
parent
e31433f320
commit
80c3416ca7
@ -342,16 +342,15 @@ def check_zip_release(self, id, path):
|
||||
def check_all_zip_files():
|
||||
result = []
|
||||
|
||||
with get_temp_dir() as temp:
|
||||
releases = PackageRelease.query.all()
|
||||
for release in releases:
|
||||
with ZipFile(release.file_path, 'r') as zf:
|
||||
if not _check_zip_file(temp, zf):
|
||||
print(f"Unsafe zip file for {release.package.get_id} at {release.file_path}", file=sys.stderr)
|
||||
result.append({
|
||||
"package": release.package.get_id(),
|
||||
"file": release.file_path,
|
||||
})
|
||||
releases = PackageRelease.query.all()
|
||||
for release in releases:
|
||||
with ZipFile(release.file_path, 'r') as zf:
|
||||
if not _check_zip_file("/tmp/example", zf):
|
||||
print(f"Unsafe zip file for {release.package.get_id()} at {release.file_path}", file=sys.stderr)
|
||||
result.append({
|
||||
"package": release.package.get_id(),
|
||||
"file": release.file_path,
|
||||
})
|
||||
|
||||
return json.dumps(result)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user