Welcome to CRUX bug tracking.

FS#1385 - pkgmk - add/use source mirrors as fallback

Attached to Project: CRUX
Opened by Fun (fun) - Tuesday, 28 February 2017, 03:49 GMT
Last edited by Fredrik Rinnestam (frinnst) - Saturday, 08 July 2017, 22:07 GMT
Task Type Improvement
Category tools → pkgutils
Status Closed
Assigned To No-one
Operating System CRUX
Severity Low
Priority Normal
Reported Version 3.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


The current use of PKGMK_SOURCE_MIRRORS functions like a cache.
It might make sense used with a local/near/fast web server, but I doubt the download speed gain is worth compared with the build time, not to mention that it also adds some burden on the web server mirroring the sources.

I think is better using the mirrors after the source's direct link is tried, not before.
This will help making PKGMK_SOURCE_MIRRORS=( default :).

If there is a current use case in which the use of PKGMK_SOURCE_MIRRORS is still better as is this, I've attached a patch for a fallback set of mirrors - PKGMK_SOURCE_MIRRORS_FALLBACK. I know it is an ugly copy/paste. I promise I'll refactor the download_file() function if accepted.
This task depends upon

Closed by  Fredrik Rinnestam (frinnst)
Saturday, 08 July 2017, 22:07 GMT
Reason for closing:  Won't fix
Comment by Fredrik Rinnestam (frinnst) - Tuesday, 28 February 2017, 10:59 GMT
Im not sure we want that right now.
1. is currently not a very elegant solution :->
2. It should be up to the user to specify this.
Comment by Fun (fun) - Tuesday, 28 February 2017, 17:02 GMT
Then, maybe Romster won't mind to have its server as the default mirror for all CRUX installs. lol

I've remember complains about packages not downloaded, in some old CRUX reviews, on wiki, etc. And, 2-3 weeks ago, dash or some other package from core could not be downloaded. So, I've put into PKGMK_SOURCE_MIRRORS, but then I've seen that pkgmk was using for all downloads, and I felt is not right to let that in place.

I agree with you that a lot are up to the user, and is hard to keep the things simple, because the most natural think to do is to add and to change, and I also know that changing defaults, even in better, could be painful and unwise, but I think you will agree with me that the defaults are important too. And will help everybody if things go smoother with the downloads.

Comment by Fun (fun) - Wednesday, 03 May 2017, 09:31 GMT
frinnst, you've said "it's up to the user" and I guess it is about setting the default mirror (PKGMK_SOURCE_MIRRORS) not about PKGMK_SOURCE_MIRRORS_FALLBACK (a way to use mirrors only if the official links fails).
Comment by Fun (fun) - Wednesday, 17 May 2017, 21:53 GMT
I've made a patch for /etc/pkgmk.conf, to add support for PKGMK_SOURCE_MIRRORS_FALLBACK with the official pkgmk