void-packages
void-packages copied to clipboard
[Draft] xbps-src: clean up fetch hook and allow mirroring
As an alternative to https://github.com/void-linux/void-packages/pull/38438
Allow mirroring by having multiple distfiles for the same target file name, either by url or by ">filename".
Hmm do you really think it is worth the extra complexity? How many similar cases might we have besides CRAN?
The extra complexity isn't that big, I expect this change to reduce the number of lines, at the moment its like +11 lines.
Its basically just creating a per distfile target list of indexes into the distfiles
and checksum
variables and then tries to download each distfile target by looping through the per target indexes until a download is successful.
The looping already exists for XBPS_DISTFILES_MIRROR
and the current implementation kinda already works by indexing into distfiles+checksums but in a weird way, which is why the rewrite will be more compact/simpler, by just using indexed arrays.
Any word on this? I am trying it out and it seems to work alright, although I guess I have to duplicate the checksums in all my templates.