Giter VIP home page Giter VIP logo

Comments (1)

ddalcino avatar ddalcino commented on September 15, 2024 1

Looks like the Qt maintainers changed the directory structure, again.

Incomplete listing of directories at https://download.qt.io/online/qtsdkrepository/linux_x64/android/:

  • qt6_600_x86_64/
  • qt6_600_x86/
  • qt6_600_armv7/
  • qt6_600_arm64_v8a
  • qt6_600/
  • qt6_7_3/
  • qt6_7_2/
  • qt6_7_1/
  • qt6_7_0/
  • qt5_51212/
  • qt5_51211/
  • qt5_51210/

Currently, the following code splits up the folder name on _, and the string of digits following qt5 or qt6 is interpreted as the version of Qt. So, 51212 gets split up into 5.12.12 and 600 gets split up into 6.0.0. However, qt6_7_3 gets mangled, because aqt thinks that 7 is the whole version string, when it actually refers to version 6.7.3.

aqtinstall/aqt/metadata.py

Lines 779 to 786 in 73fc45e

def folder_to_version_extension(folder: str) -> Tuple[Optional[Version], str]:
components = folder.split("_", maxsplit=2)
ext = "" if len(components) < 3 else components[2]
ver = "" if len(components) < 2 else components[1]
return (
get_semantic_version(qt_ver=ver, is_preview="preview" in ext),
ext,
)

Also see get_semantic_version_string here:

aqtinstall/aqt/metadata.py

Lines 172 to 197 in 73fc45e

def get_semantic_version(qt_ver: str, is_preview: bool) -> Optional[Version]:
"""Converts a Qt version string (596, 512, 5132, etc) into a semantic version.
This makes a lot of assumptions based on established patterns:
If is_preview is True, the number is interpreted as ver[0].ver[1:], with no patch.
If the version is 3 digits, then major, minor, and patch each get 1 digit.
If the version is 4 or more digits, then major gets 1 digit, minor gets 2 digits
and patch gets all the rest.
As of May 2021, the version strings at https://download.qt.io/online/qtsdkrepository
conform to this pattern; they are not guaranteed to do so in the future.
"""
if not qt_ver or any(not ch.isdigit() for ch in qt_ver):
return None
if is_preview:
return Version(
major=int(qt_ver[:1]),
minor=int(qt_ver[1:]),
patch=0,
prerelease=("preview",),
)
elif len(qt_ver) >= 4:
return Version(major=int(qt_ver[:1]), minor=int(qt_ver[1:3]), patch=int(qt_ver[3:]))
elif len(qt_ver) == 3:
return Version(major=int(qt_ver[:1]), minor=int(qt_ver[1:2]), patch=int(qt_ver[2:]))
elif len(qt_ver) == 2:
return Version(major=int(qt_ver[:1]), minor=int(qt_ver[1:2]), patch=0)
raise ValueError("Invalid version string '{}'".format(qt_ver))

Please also note that this means it is currently impossible to install Qt 6.7.* for Android without using the all_os directory, because the installer won't be able to find these folders either.

from aqtinstall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.