mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-31 18:27:30 +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():
|
def check_all_zip_files():
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
with get_temp_dir() as temp:
|
releases = PackageRelease.query.all()
|
||||||
releases = PackageRelease.query.all()
|
for release in releases:
|
||||||
for release in releases:
|
with ZipFile(release.file_path, 'r') as zf:
|
||||||
with ZipFile(release.file_path, 'r') as zf:
|
if not _check_zip_file("/tmp/example", 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)
|
||||||
print(f"Unsafe zip file for {release.package.get_id} at {release.file_path}", file=sys.stderr)
|
result.append({
|
||||||
result.append({
|
"package": release.package.get_id(),
|
||||||
"package": release.package.get_id(),
|
"file": release.file_path,
|
||||||
"file": release.file_path,
|
})
|
||||||
})
|
|
||||||
|
|
||||||
return json.dumps(result)
|
return json.dumps(result)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user