default="",
help="Link to get the image from. May contain {target}, {version} and {commit}",
)
-# parser_merge.add_argument("--change-prefix",
-# help="Change the openwrt- file name prefix.")
parser_scrape = subparsers.add_parser(
"scrape",
if target is None:
target = profile["target"]
- # if args.change_prefix:
- # change_prefix(images, "openwrt-", args.change_prefix)
-
for entry in profile["titles"]:
title = get_title(entry)
content = re.sub("versions:[\\s]*{[^}]*}", f"versions: {versions}", content)
with open(config_path, "w+") as file:
- # save updated config
file.write(content)
with urllib.request.urlopen(f"{target}/?json") as file:
array = json.loads(file.read().decode("utf-8"))
for profile in filter(lambda x: x.endswith("/profiles.json"), array):
- # print(profile)
with urllib.request.urlopen(f"{target}/{profile}") as file:
profiles[f"{target}/{profile}"] = file.read()
return profiles
update_config(config_path, versions)
-"""
-def change_prefix(images, old_prefix, new_prefix):
- for image in images:
- if image["name"].startswith(old_prefix):
- image["name"] = new_prefix + image["name"][len(old_prefix):]
-"""
-
"""
Find and merge json files for a single release.
"""
profiles = {}
def add_path(path):
- # paths.append(path)
with open(path, "r") as file:
profiles[path] = file.read()