Skip to content

Commit

Permalink
[WIP] improve module check
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Feb 17, 2024
1 parent 3e2f191 commit 84fcc7f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,29 +150,37 @@ def qt_download_check_extract(cfg, dir_install):
module = "{module}",
compiler = compiler)

qt_modules = cfg['versions']['qt_modules']

extra_package_names = list()
for module in cfg['versions']['qt_modules']:
for module in qt_modules:
extra_package_names.append(extra_package_name.format(module = module))

package_archives = dict()
for package in metadata.iter("PackageUpdate"):
print("package check", package.find("Name").text, [base_package_name] + extra_package_names)
if package.find("Name").text in [base_package_name] + extra_package_names:
package_archives[package.find("Name").text] = {
"version": package.find("Version").text,
"archives": read_downloadable_archives(package)
}

archives_match = []
for module_name in cfg['versions']['qt_modules']:
# TODO: better check
if not package_archives:
raise RuntimeError("no package_archives")

module_archives = dict()
for module_name in qt_modules:
for package_name, data in package_archives.items():
for archive_name in data["archives"]:
if archive_name.startswith(module_name):
archives_match.append([package_name, data["version"], archive_name])
module_archives[module_name].append([package_name, data["version"], archive_name])

if not archives_match:
raise RuntimeError(f"no matches for Qt modules ({cfg['versions']['qt_modules']}) found")
modules_missing = qt_modules - module_archives.keys()
if modules_missing:
raise RuntimeError(f"no matches for Qt modules {modules_missing} found")

for package_name, package_version, archive_name in archives_match:
for package_name, package_version, archive_name in module_archives.values():
url_archive = base_url+'/'+package_name+'/'+package_version+archive_name

print("download", url_archive)
Expand Down

0 comments on commit 84fcc7f

Please sign in to comment.