Skip to content

Commit

Permalink
Merge pull request #1354 from kloptops/main
Browse files Browse the repository at this point in the history
Updated port.json to v4, fixed bug with images.xxx.zip.
  • Loading branch information
kloptops authored Mar 1, 2025
2 parents 1db05eb + a52fc79 commit 9485b91
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tools/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def port_info(file_name, ports_json, ports_status):
# HRMMmmmmm o_o;;;;
return

file_md5 = ports_status[clean_name]['md5']
file_md5 = ports_status[clean_name]['md5']
file_size = ports_status[clean_name]['size']

default_status = {
Expand Down Expand Up @@ -1004,7 +1004,7 @@ def generate_ports_json(all_ports, port_status, old_manifest, new_manifest):
utils.append(RELEASE_DIR / 'gameinfo.zip')
utils.append(RELEASE_DIR / 'images.zip')

if SPLIT_IMAGES:
if REPO_CONFIG.get('SPLIT_IMAGES', "N") == "Y":
for img_id in range(1000):
image_xxx_zip = f"images.{img_id:03d}.zip"

Expand Down
32 changes: 21 additions & 11 deletions tools/libs/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Port Information

PORT_INFO_ROOT_ATTRS = {
'version': 3,
'version': 4,
'name': None,
'items': None,
'items_opt': None,
Expand All @@ -31,7 +31,7 @@
'image': None,
'rtr': False,
'exp': False,
'runtime': None,
'runtime': [],
'min_glibc': "",
'reqs': [],
'arch': [],
Expand Down Expand Up @@ -183,13 +183,9 @@ def port_info_load(raw_info, source_name=None, do_default=False):
}
del info['md5']

# WHOOPS! :O
if info.get('attr', {}).get('runtime', None) == "blank":
info['attr']['runtime'] = None

if info.get('version', None) == 2:
# :D
info['version'] = 3
# WHOOPS! :O
if info.get('attr', {}).get('runtime', None) == "blank":
info['attr']['runtime'] = None

if isinstance(info.get('attr', {}).get('porter'), str):
info['attr']['porter'] = [info['attr']['porter']]
Expand All @@ -199,8 +195,22 @@ def port_info_load(raw_info, source_name=None, do_default=False):
key
for key in info['attr']['reqs']]

if isinstance(info.get("version", None), str):
info["version"] = int(info["version"])
# Version 3 to 4
if info.get('version', None) == 3:
info['version'] = 4

if info['attr']['runtime'] is None:
info['attr']['runtime'] = []

elif isinstance(info['attr']['runtime'], str):
info['attr']['runtime'] = [ info['attr']['runtime'] ]

# Catch errors because who fucking uses version numbers.
if info.get('attr', {}).get('runtime', []) == None:
info['attr']['runtime'] = []

if isinstance(info.get('attr', {}).get('runtime', []), str):
info['attr']['runtime'] = [ info['attr']['runtime'] ]

# This strips out extra stuff
port_info = {}
Expand Down

0 comments on commit 9485b91

Please sign in to comment.