userland-fetch: improvements for downloading and hashing
HASH_DIR support: search for an envvar HASH_DIR, a hashes/ directory in the directory of --file, or a hashes/ in the current directory. If found, look inside the files in that directory for checksums in the format outputted by sha256sum. Checksum files will be used if --hash is not provided.
partial downloads: any cancelled download leaves a .part file, which can be continued later if the server supports it or will be overwritten if not.
retrying: if there is a retryable network error, userland-fetch will try to continue the download once or twice before quitting.
security tests: fail on unsecured, unhashed download with no signature.
Removed deprecated splithost and splittype commands.
Tested partial downloads, HASH_DIR, and unsecured downloading here.
developer/cmocka has a problem with your userland-fetch:
/export/home/andreas/oi-userland/tools/userland-fetch --file /Projekte/OpenIndiana/userland-sources/cmocka-cmocka-1.1.5.tar.gz --url https://gitlab.com/cmocka/cmocka/-/archive/cmocka-1.1.5/cmocka-cmocka-1.1.5.tar.gz --hash sha256:51eba78277d51f0299617bedffc388b2b4ea478f5cc9876cc2544dae79638cb0
INFO: not searching /Projekte/OpenIndiana/userland-sources/hashes for cmocka-cmocka-1.1.5.tar.gz (overridden with --hash)
Source /Projekte/OpenIndiana/userland-sources/cmocka-cmocka-1.1.5.tar.gz... not found, skipping file copy
Source https://gitlab.com/cmocka/cmocka/-/archive/cmocka-1.1.5/cmocka-cmocka-1.1.5.tar.gz...
downloading... Traceback (most recent call last):
File "/export/home/andreas/oi-userland/tools/userland-fetch", line 605, in
Give me a hint when you are done and I can merge this.
I still need to write docs for it, but all of the functionality seems to work.
I'm going to prep the component dir overnight and see if anything extra fails.
What is the state of this PR? Shall I merge #9269 first and you'll update yours then?
Sorry about the delay. Yes, merge #9269 and I will rebase my branch.
I'm going to see if I can finish testing in about a week (including making some changes to prep-*.mk). If you've taken a look and see anything you'd like changed or improved, let me know.
The last feature I'm putting in is to have userland-fetch grab hash or signature files automatically using -g and -G, respectively. After that we should be able to let the build system validate all archives without copy/pasting hashes.
I'll need to do one more pass of the components dir to check for issues before this can be merged.
This should be ready now. gmake prep downloaded, unpacked and patched most of the components, and I've fixed any errors related to userland-fetch. I also wrote a quick test script for the hashfile features, which are all working as intended.
None of the -gGnNc functionality is used by default, so it shouldn't disturb anything.