diff mbox

[pacman-dev] makepkg.conf: add default protocol handler for file:// urls.

Message ID 20180503013258.3416-1-eschwartz@archlinux.org
State Accepted, archived
Headers show

Commit Message

Eli Schwartz May 3, 2018, 1:32 a.m. UTC
This is a common URI scheme (in general if not in makepg) and we should
provide a handler for it. We already allow its use for locally sourced
git repositories, so it makes sense to not leave files out.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 etc/makepkg.conf.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Allan McRae May 12, 2018, 11:17 a.m. UTC | #1
On 03/05/18 11:32, Eli Schwartz wrote:
> This is a common URI scheme (in general if not in makepg) and we should
> provide a handler for it. We already allow its use for locally sourced
> git repositories, so it makes sense to not leave files out.
> 
> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
>  etc/makepkg.conf.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
> index fe3858ad..4d6ab78d 100644
> --- a/etc/makepkg.conf.in
> +++ b/etc/makepkg.conf.in
> @@ -8,7 +8,8 @@
>  #
>  #-- The download utilities that makepkg should use to acquire sources
>  #  Format: 'protocol::agent'
> -DLAGENTS=('ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
> +DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'

why not use "cp"?

> +          'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
>            'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
>            'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
>            'rsync::/usr/bin/rsync --no-motd -z %u %o'
>
Eli Schwartz May 13, 2018, 2:53 a.m. UTC | #2
On 05/12/2018 07:17 AM, Allan McRae wrote:
> On 03/05/18 11:32, Eli Schwartz wrote:
>> This is a common URI scheme (in general if not in makepg) and we should
>> provide a handler for it. We already allow its use for locally sourced
>> git repositories, so it makes sense to not leave files out.
>>
>> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
>>  etc/makepkg.conf.in | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
>> index fe3858ad..4d6ab78d 100644
>> --- a/etc/makepkg.conf.in
>> +++ b/etc/makepkg.conf.in
>> @@ -8,7 +8,8 @@
>>  #
>>  #-- The download utilities that makepkg should use to acquire sources
>>  #  Format: 'protocol::agent'
>> -DLAGENTS=('ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
>> +DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
> 
> why not use "cp"?

1) no need to strip the file:/// bit by special-casing file:// like we
do scp. Why make file:// filesystem-aware in ways that nothing else is
anyway?

2) cp preserves attributes like the executable bit, which http urls
specifically don't; cp is therefore inconsistent.

3) cp is silent, which would make it the only DLAGENTS which is by
default silent.

4) it's thematically consistent with using the same thing lots of times.

I guess we could use /usr/bin/cp --no-preserve=mode -v

But this still leaves special-casing file:// which IMHO introduces
slightly magic behavior and I don't like using something other than the
actual contents of the source=() except as explicitly documented in the
PKGBUILD(5) manpage for :: and +
Allan McRae May 13, 2018, 3:03 a.m. UTC | #3
On 13/05/18 12:53, Eli Schwartz wrote:
> On 05/12/2018 07:17 AM, Allan McRae wrote:
>> On 03/05/18 11:32, Eli Schwartz wrote:
>>> This is a common URI scheme (in general if not in makepg) and we should
>>> provide a handler for it. We already allow its use for locally sourced
>>> git repositories, so it makes sense to not leave files out.
>>>
>>> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
>>>  etc/makepkg.conf.in | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
>>> index fe3858ad..4d6ab78d 100644
>>> --- a/etc/makepkg.conf.in
>>> +++ b/etc/makepkg.conf.in
>>> @@ -8,7 +8,8 @@
>>>  #
>>>  #-- The download utilities that makepkg should use to acquire sources
>>>  #  Format: 'protocol::agent'
>>> -DLAGENTS=('ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
>>> +DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
>>
>> why not use "cp"?
> 
> 1) no need to strip the file:/// bit by special-casing file:// like we
> do scp. Why make file:// filesystem-aware in ways that nothing else is
> anyway?
> 
> 2) cp preserves attributes like the executable bit, which http urls
> specifically don't; cp is therefore inconsistent.
> 
> 3) cp is silent, which would make it the only DLAGENTS which is by
> default silent.
> 
> 4) it's thematically consistent with using the same thing lots of times.
> 
> I guess we could use /usr/bin/cp --no-preserve=mode -v
> 
> But this still leaves special-casing file:// which IMHO introduces
> slightly magic behavior and I don't like using something other than the
> actual contents of the source=() except as explicitly documented in the
> PKGBUILD(5) manpage for :: and +
> 

Good enough explanation for me.

A
diff mbox

Patch

diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index fe3858ad..4d6ab78d 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -8,7 +8,8 @@ 
 #
 #-- The download utilities that makepkg should use to acquire sources
 #  Format: 'protocol::agent'
-DLAGENTS=('ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
+DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
+          'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
           'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
           'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
           'rsync::/usr/bin/rsync --no-motd -z %u %o'