void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

[Draft] xbps-src: clean up fetch hook and allow mirroring

Open Duncaen opened this issue 1 year ago • 2 comments

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

Duncaen avatar Aug 06 '22 02:08 Duncaen

Hmm do you really think it is worth the extra complexity? How many similar cases might we have besides CRAN?

CameronNemo avatar Aug 07 '22 17:08 CameronNemo

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.

Duncaen avatar Aug 07 '22 18:08 Duncaen

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.

CameronNemo avatar Sep 06 '22 02:09 CameronNemo