Open ajkerzner opened 3 years ago
What is the context you are using it in?
No, there is not a way.
There is no feature to reuse archives, and an option not to remove downloaded archive. It is a reason why there is no way to cache, but you are welcome to improve aqtinstall and send Pull-Request as usual.
Here is a patch to add '--keep' option to keep downloaded archive.
You can use downloaded *.7z
files.
You can also use '-O' output directory option to specify target directory. https://github.com/miurahr/aqtinstall/pull/225
There is still NO way to reuse existent files, if it exist, aqt might download it again and overwrite it.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Here is how I use aqt install
offline (e.g. for MinGW 32 or 64 bit installations) :
qt5-default-5.15.2\online\qtsdkrepository\windows_x86\desktop\qt5_5152
folder with data from e.g. ftp://mirrors.dotsrc.org/.mirrors/qtproject/online/qtsdkrepository/windows_x86/desktop/qt5_5152 and run in qt5-default-5.15.2
folder from the computer with the Internet :
python -m pip download --only-binary :all: -r requirements.txt
with
requests==2.25.1
aqtinstall==1.1.6
texttable
packaging
in requirements.txt
.
python -m pip install --only-binary :all: --no-index --find-links qt5-default-5.15.2 -r qt5-default-5.15.2\requirements.txt
--base
parameter of aqt install
, which does not seem to accept directly local folders (firewall might need to be configured to temporarily allow TCP port 8000, e.g. netsh advfirewall firewall add rule name="Open Port 8000 TCP" dir=in action=allow protocol=TCP localport=8000
) :
start python -m http.server --directory qt5-default-5.15.2
7zip
) :
aqt install -E 7z --base http://127.0.0.1:8000/ --outputdir C:\Qt 5.15.2 windows desktop win64_mingw81 -m qtcharts qtscript
@lebarsfa Thank you for the idea.
It may be good idea to support file://
URL for --base
Because aqt now always uses requests
http client library, it may not handle file://
URL schema.
@miurahr I would like to see this feature in aqt to speed up my CI setup. So to do this we would need a new --cache
option that uses the --keep
downloaded 7zip files and then only downloads the hashsums and checks if they match to the local 7zip files, right?
Probably since around v2.1.0, the idea I mentioned above -- i.e. download e.g. ftp://mirrors.dotsrc.org/.mirrors/qtproject/online/qtsdkrepository/windows_x86/desktop/qt5_5152 to a local folder qt5-default-5.15.2
, then start a local server e.g. using python -m http.server --directory qt5-default-5.15.2
and then use aqt
with --base http://127.0.0.1:8000/
parameter on a computer without the Internet -- does not work any more as is possibly due to the check of sha256 mentioned in https://github.com/miurahr/aqtinstall/issues/521.
The easiest workaround at the moment is probably to keep using aqt v2.0.6.
Otherwise, it seems that we would have to change trusted_mirrors
in settings.ini
to http://127.0.0.1:8000/
and ensure we have downloaded all the sha256 files from https://download.qt.io.
I don't know if there are better ideas if you had set up a local folder using a standard mirror, updated aqt, but have now a limited Internet connection...
Pull-Request is always welcome if you can add features such as 1) save sha256 file when --keep specified, and 2) download/read fron local storage when specified URL with file:// scheme.
Is there a way to cache downloads with this tool and reuse previously downloaded downloads? I am curious.