[pacman-dev] [PATCH] Added mirror support to makepkg's source array.

Allan McRae allan at archlinux.org
Mon Nov 25 00:46:39 EST 2013


On 25/11/13 07:36, Ido Rosen wrote:
> On Wed, Nov 20, 2013 at 7:55 PM, Xyne <xyne at archlinux.ca> wrote:
> 
>> On 2013-11-18 12:09 +1000
>> Allan McRae wrote:
>>
>>> What did you think about the proposal in an earlier reply to this thread:
>>>
>>> source=("mirror://_foo/blah/blah/foo.tar.gz")
>>> _foo=("http://foo.com/" "http://bar.com/")
>>>
>>> I think we can bet safely that "mirror://" will not become a valid
>>> protocol.  And we are replacing the start of the URL so just using the
>>> initial "/" as the delimiter is fine.
>>>
>>> Allan
>>
>> That works, but I would prefer differential syntax to prevent confusion
>> with
>> regular URLs. "MIRROR://" should be enough. It stands out, and we already
>> use
>> upper-case for "SKIP" in the checksums array, so I think it is
>> stylistically
>> coherent.
>>
>> Regards,
>> Xyne
>>
> 
> In the interest of getting mirror support into PKGBUILD/makepkg/pacman,
> regardless of style or aesthetic considerations.  Seems like these are the
> two current options being considered:
> 
> (a) my original patch (multiple same-filenamed entries in $source), or,
> (b) the proposal of having
>     [dest_filename::]mirror://<_identifier>/[path_prefix/]<filename>
> ...scheme that references a shell variable or function name to get the list
> from.
> 
>>From my perspective:   (a) is already written and easy to grok, involving
> relatively minor changes to makepkg.sh.in;  (b) is more flexible but
> involves duplication of code in makepkg, multiple entrypoints into
> download_* functions...

I think b) will involve a single function to be added (download_mirror)
which loops and passes to the download_... functions as necessary.  So
it is very self contained.  And the duplication of farming out to the
right function can be refactored.

> So, do we vote or does Allan decide or do we roll dice? :-)  I'm happy to
> resubmit the patch either way.

I decide! :)   But I tend to listen to votes containing explanations...

One question needs answered first.  Should there be able to be two
different mirror arrays.   I.e. If a PKGBUILD has multiple source files
available across mirrors, will those be the same mirrors?

If the answer is no, we can simplify this some more to:

source=('mirror://foo/foo.tar.xz')
mirror=('http://bar.com/download' 'http://baz.com/mirror/download')

My gut feeling is in two parts:
1) if your PKGBUILD requires two different mirror arrays, you are
probably doing it wrong
2) I doubt the number of packages using mirrors will be large, yet along
needing two mirror arrays.

Allan


More information about the pacman-dev mailing list