Skip to content

Commit

Permalink
look for modules in extensions directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Nov 27, 2024
1 parent 0392095 commit 1d528c2
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
from aqt.helper import Settings, get_hash, getUrl, ssplit
from aqt.metadata import QtRepoProperty, Version

@dataclass
class UpdateXmls:
target_folder: str
xml_text: str

@dataclass
class TargetConfig:
Expand Down Expand Up @@ -354,6 +358,7 @@ def _target_packages(self) -> ModuleToPackage:
package_names = [
f"qt.qt{self.version.major}.{self._version_str()}.{suffix}",
f"qt.{self._version_str()}.{suffix}",
f"extensions.{module}.{self._version_str()}.{self.arch}",
]
if not module.startswith("addons."):
package_names.append(f"qt.qt{self.version.major}.{self._version_str()}.addons.{suffix}")
Expand Down Expand Up @@ -399,7 +404,24 @@ def _get_archives_base(self, name, target_packages):
)
update_xml_url = posixpath.join(os_target_folder, "Updates.xml")
update_xml_text = self._download_update_xml(update_xml_url)
self._parse_update_xml(os_target_folder, update_xml_text, target_packages)
arch = self.arch
if self.os_name == "windows":
arch = self.arch.replace("win64_", "", 1)
elif self.os_name == "linux":
arch = "x86_64"
elif self.os_name == "linux_arm64":
arch = "arm64"
extensions_target_folder = posixpath.join(
"online/qtsdkrepository",
os_name,
"extensions/qtwebengine",
self._version_str(),
arch
)
extensions_xml_url = posixpath.join(extensions_target_folder, "Updates.xml")
extensions_xml_text = self._download_update_xml(extensions_xml_url)
update_xmls = [UpdateXmls(os_target_folder, update_xml_text), UpdateXmls(extensions_target_folder, extensions_xml_text) ]
self._parse_update_xmls(update_xmls, target_packages)

def _download_update_xml(self, update_xml_path):
"""Hook for unit test."""
Expand Down Expand Up @@ -451,6 +473,10 @@ def _parse_update_xml(self, os_target_folder, update_xml_text, target_packages:
pkg_update_name=packageupdate.name, # For testing purposes
)
)

def _parse_update_xmls(self, update_xmls, target_packages: Optional[ModuleToPackage]):
for update_xml in update_xmls:
self._parse_update_xml(update_xml.target_folder, update_xml.xml_text, target_packages)
# if we have located every requested package, then target_packages will be empty
if not self.all_extra and len(target_packages) > 0:
message = f"The packages {target_packages} were not found while parsing XML of package information!"
Expand Down

0 comments on commit 1d528c2

Please sign in to comment.