miurahr / aqtinstall

aqt: Another (unofficial) Qt CLI Installer on multi-platforms
https://aqtinstall.readthedocs.io/en/latest/
MIT License
912 stars 84 forks source link

Feature: install from local cached download archives #224

Open ajkerzner opened 3 years ago

ajkerzner commented 3 years ago

Is there a way to cache downloads with this tool and reuse previously downloaded downloads? I am curious.

vadi2 commented 3 years ago

What is the context you are using it in?

miurahr commented 3 years ago

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.

miurahr commented 3 years ago

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.

github-actions[bot] commented 3 years ago

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

lebarsfa commented 2 years ago

Here is how I use aqt install offline (e.g. for MinGW 32 or 64 bit installations) :

miurahr commented 2 years ago

@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.

kelteseth commented 1 year ago

@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?

lebarsfa commented 1 year ago

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...

miurahr commented 1 year ago

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.