On Thu, Oct 31, 2013 at 4:51 PM, Ido Rosen <ido@kernel.org> wrote:
On Thu, Oct 31, 2013 at 4:45 PM, Dave Reisner <d@falconindy.com> wrote:
On Thu, Oct 31, 2013 at 08:32:49PM +0000, Jerome Leclanche wrote:
What about reusing the "filename" feature; if it sees multiple times the same files it treats it as a mirror, eg. "file.tar.gz::http://example.com/file.tar.gz" "file.tar.gz::http://mirror.example.com/file.tar.gz"
J. Leclanche
This can't work. If the first source fails to download, makepkg will abort.
What about just detecting if source is an array/list (keep current behavior), or a dictionary/lookup table (new fancy mirror behavior)? If it's a dictionary/lookup table, then try all mirrors before failing a source download.
For examples of how to create lookup tables in bash, see http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash...
Just to be clear, I meant a dictionary/lookup table of strings or list values, e.g.: source=( ["file.tar.gz"]=("http://a.com/file.tar.gz" " http://b.com/file.tar.gz") ) # would indicate file.tar.gz has 2 mirror URLs.