Commit Graph

488 Commits

Author SHA1 Message Date
Qt Repo Watchbot
f652f0fa9c Update aqt/combinations.json 2022-06-01 00:25:29 +00:00
Dave Dalcino
06c84ec199 Simplify AqtException.suggested_action
This clarifies that suggested_action is always a List, so that it can
be appended to, rather than totally reassigned.
2022-04-19 19:16:13 -07:00
Dave Dalcino
e8672f3fbe Allow MetadataFactory to recover from bad HTML files
This change allows MetadataFactory.iterate_folders to recognize when
MetadataFactory has retrieved a malformed HTML file, or an HTML file
that does not contain the table and rows that it expects to see.

If the URL is correct, it should retrieve the right page, but this is
not guaranteed, and MetadataFactory should be able to recover and
generate an appropriate error message.

One possible situation where this kind of error might occur could be
when the user is connected to a public WIFI network, but not logged in.
The router would redirect aqt to the network login page, and aqt would
have no way of knowing that it did not receive the correct page.
Aqt should be resilient to this kind of error.
2022-04-19 18:26:21 -07:00
David Dalcino
ad20856738 Fix patching of Qt6.2.2-ios (#510)
* Add tests for proper patching of Qt6.2.2-ios
* Add a build target for ios installations
* Add test coverage for mobile patching on linux

This change folds in some refactoring as well, in an attempt to reduce
repetitive logic, and make sure that this logic is used everywhere appropriate.
2022-04-04 14:22:13 +09:00
David Dalcino
dc45839df4 Fix implementation of helper.get_hash
Causes `get_hash` to verify the hash length, and check that the hash can
be unhexlified properly.

Fixes the interface for `get_hash` so that the caller does not have to
run `binascii.unhexlify` or verify its output.
2022-03-20 14:16:24 -07:00
Qt Repo Watchbot
d3fb01f0b9 Update aqt/combinations.json 2022-03-20 03:45:15 +00:00
David Dalcino
6bd438bcb1 Use secrets for secure random numbers 2022-03-10 17:35:30 -08:00
David Dalcino
5ad7c1a058 Use defusedxml to parse Updates.xml files
I don't think we can really call the `Updates.xml` files that we are
parsing 'untrusted xml', because we are checking that they match the
sha256 checksum. However, I don't think there's any good reason not to
use a more secure parsing algorithm.
2022-03-10 17:23:58 -08:00
David Dalcino
b62db9ee2a Allow MetadataFactory.fetch_http to skip sha256
`MetadataFactory.fetch_http` must often download HTML pages, not
Updates.xml files. download.qt.io does not store checksums for these
files, so this particular function must be allowed to download these
pages without using a checksum.
2022-03-06 18:16:37 -08:00
David Dalcino
12d20a3d06 Fix failure to use fallback for getlist
aqt.helper.MyConfigParser.getlist fails to retrieve a fallback list when
the `section` parameter does not exist in the `settings.ini` file.
This ensures that the fallback is used when that key is missing.
2022-03-06 17:56:26 -08:00
David Dalcino
5a7adb60cf Check hashes for xml files 2022-03-06 17:56:26 -08:00
David Dalcino
f979d80899 WIP use checksums for updates.xml files 2022-03-06 17:56:25 -08:00
David Dalcino
2c5c261592 It's no secret that we need a random number! 2022-03-06 17:36:33 -08:00
David Dalcino
96af3eb393 Refactor: split QtArchive.archive_url into parts
This splits QtArchive.archive_url into two new datamembers: archive_path
and base_url. Ultimately, base_url should be removed from QtPackage
entirely.
2022-03-06 17:36:32 -08:00
David Dalcino
7ebd6aa34e Use sha256 hashes only from trusted mirrors
To keep this commit small, `hashurl` was removed from QtPackage, and
`get_hash` constructs the hash url based on the url of the 7z archive
to download. I think that in the future, QtArchive and QtPackage could
be refactored to construct this url more appropriately. However, this
would be a complicated change that doesn't belong in this commit.
2022-03-06 17:36:32 -08:00
David Dalcino
b92ee9935d Add setting for trusted_mirrors 2022-03-06 17:36:32 -08:00
Qt Repo Watchbot
9130153e67 Update aqt/combinations.json 2022-02-28 10:45:15 +00:00
Hiroshi Miura
cb7eaeeb2a Update 64bit python detection
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-02-11 11:00:27 +09:00
Hiroshi Miura
459bd4407c Merge pull request #486 from miurahr/update-combinations
Update `aqt/combinations.json`
2022-02-10 22:05:04 +09:00
Christian Hoffmann
10e5bdf898 Update fallback mirror list
Some of the currently listed mirrors are no longer part of the official
mirror list by qt.io, some return 404, some don't fully mirror the
tree.

The list has been generated via the following one-liner:
blacklist=$(sed -rne '/blacklist:/,/fallbacks:/p ' aqt/settings.ini); for mirror in $(curl -s https://download.qt.io/static/mirrorlist/ | grep -oP 'href="\K(http.*)(?=">HTTP</a>)' | sed -re 's|^http:|https:|; s|([^/])$|\1/|'); do grep -qF "$(sed -re 's|^https?://([^/]+).*$|\1|' <<<"${mirror}")" <<<"$blacklist" && continue; code=$(curl -I "${mirror}online/qtsdkrepository/windows_x86/desktop/qt6_623/qt.qt6.623.win64_msvc2019_64/6.2.3-0-202201260729qtbase-Windows-Windows_10_21H2-MSVC2019-Windows-Windows_10_21H2-X86_64.7z" --write-out '%{response_code}' --silent -o /dev/null); [[ $code == 200 ]] && echo "    ${mirror}"; done
2022-02-06 23:54:40 +01:00
Qt Repo Watchbot
77b445f3ea Update aqt/combinations.json 2022-02-06 22:54:36 +00:00
Qt Repo Watchbot
04e4f16019 Update aqt/combinations.json 2022-02-01 00:16:23 +00:00
Qt Repo Watchbot
c97cdff7bf Update aqt/combinations.json 2022-01-26 05:24:12 +00:00
Hiroshi Miura
eaf5a46e48 Merge pull request #459 from ddalcino/fix-archives-flag
Restrict effect of `--archives` flag to base and debug_info modules
2022-01-26 14:21:47 +09:00
Hiroshi Miura
2dae2fcf71 Merge pull request #479 from miurahr/topic-update-xml-delimiter-wo-space
Accept Update.xml that use comma without space as delimiter
2022-01-13 15:45:22 +09:00
Hiroshi Miura
9b66f03718 Accept Update.xml that use comma without space as delimiter
resolve #475

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-01-12 22:24:16 +09:00
Hiroshi Miura
948fb18650 Test: helper: update mock for requests.sessions.Session
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-01-11 20:36:34 +09:00
Hiroshi Miura
87f95ddc59 Fix behavior that getUrl() does not retry
getUrl() now use `requests.get()` that is default getter that does not retry.
This change corrects it to `session.get()`

Related issue #472

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-01-11 15:22:29 +09:00
David Dalcino
8a289e922c Merge remote-tracking branch 'upstream/master' into fix-archives-flag 2021-12-13 18:17:17 -08:00
Hiroshi Miura
f86f6aa321 Explicit triggering garbage collection
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-12-07 20:32:09 +09:00
Hiroshi Miura
38cf9cbcef Limit maxtasksperchild=1 for pool on 32bit python
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-12-07 20:11:16 +09:00
Hiroshi Miura
9833124237 Set maxtasksperchild=1 for download and extraction pool
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-12-07 17:08:34 +09:00
David Dalcino
633cbacc62 Update docs and help text for --archives 2021-12-05 11:53:42 -08:00
David Dalcino
9c706a270c Fix implementation of --archives flag 2021-12-05 11:53:38 -08:00
David Dalcino
078154c0db refactor QtArchives base pkg name accessors
This adds an accessor function, `QtArchives._base_package_names`,
that returns a list of all possible PackageUpdate.Name properties
for the base package

This also renames `QtArchives._base_target_package_name` to
`_base_module_name`, so that its meaning is more clear in context
and not so easy to confuse with the new function.
2021-12-05 11:53:35 -08:00
David Dalcino
022373683b Allow SrcDocExamplesArchives to omit base
This change allows for the future implementation of a `--noarchives`
flag for the `install-src/doc/example` commands.
I don't know if end users will need this or not, but I need this to
determine whether or not archive filtration works properly.
This property is tested in `tests/test_archive.py` at
`test_archives_weird_module_7z_name()`.
2021-12-05 11:53:31 -08:00
Qt Repo Watchbot
ed7a1db367 Update aqt/combinations.json 2021-12-01 22:35:00 +00:00
Hiroshi Miura
3f78bd1e84 Merge pull request #455 from ddalcino/topic-fix-453
Fix problems with `install-src/doc/examples`
2021-12-02 07:33:06 +09:00
Qt Repo Watchbot
0871453709 Update aqt/combinations.json 2021-12-01 00:16:38 +00:00
David Dalcino
d6a6f79740 Prevent listing modules <= 40 bytes uncompressed
This prevents `list-*` from printing any module whose uncompressed size
is 40 bytes or less.

I have found a couple of modules that are exactly 40 bytes, and they
include no files, only empty directories. If any user tries to install
these modules, they will think that aqt failed to install the module
without printing any error message. I prefer to avoid this issue
by preventing `aqt list-*` from printing them.

`aqt install-*` is unaffected by this change, and it can still install
modules that contain no files. It is likely that we will need to print
a warning when this occurs.

If any user disagrees with the threshold value of 40 bytes, they are
free to adjust that value to their liking in `settings.ini`.
2021-11-26 14:04:10 -08:00
David Dalcino
05cc2347c7 Merge branch 'master' into topic-fix-453 2021-11-24 22:01:27 -08:00
David Dalcino
7d5ee32ac3 Add settings entries for --keep & --archive-dest
This allows a user to turn on `--keep` every time they run the program,
and to set the default archive destination when `--keep` is turned on.
Using `--archive-dest` overrides the archive destination in setting.ini.
2021-11-24 14:01:26 -08:00
David Dalcino
db4db6c9a4 Implement --archive-dest feature 2021-11-24 13:30:48 -08:00
David Dalcino
3af9c97ba0 Refactor: Allow modifiable download dest path
This adds the parameter `archive_dest` to `run_installer`, which will
control where `helper.downloadBinaryFile` will download files, and sets
it to "." by default.

For convenience/readability, this will also turn any reference to the
downloaded file into a `pathlib.Path` object. This makes it easier to
ensure that the file ends up in the right location.
2021-11-24 13:29:20 -08:00
David Dalcino
678387ccad Fix help text for list-see 2021-11-23 15:17:36 -08:00
David Dalcino
cfc241002d Fix suggestions for src/doc/ex missing modules 2021-11-23 12:17:03 -08:00
David Dalcino
d9733363bc remove --modules flag from install-src 2021-11-23 11:10:14 -08:00
David Dalcino
6d1ff77cd4 Change target param for install-src/doc/example
This changes the CLI so that the `target` parameter for `install-src`,
`install-doc`, and `install-example` is now ignored, and "desktop" is
substituted for anything the user inputs. The only valid option here
is "desktop" anyway, so the user should be forgiven for trying to input
anything else.

It may be better to remove `target` from the parameter list, but that's
a big change to the interface that could break a lot of dependent code.
2021-11-23 11:10:10 -08:00
David Dalcino
e6cd276e20 Add impl of list-src/doc/examples 2021-11-23 11:08:11 -08:00
Qt Repo Watchbot
a1227d61ee Update aqt/combinations.json 2021-11-15 00:28:32 +00:00