GNU bug report logs -
#26191
Allow custom FTP logins.
Previous Next
Reported by: Roel Janssen <roel <at> gnu.org>
Date: Mon, 20 Mar 2017 12:11:01 UTC
Severity: normal
Done: Roel Janssen <roel <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26191 in the body.
You can then email your comments to 26191 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#26191
; Package
guix-patches
.
(Mon, 20 Mar 2017 12:11:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Roel Janssen <roel <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 20 Mar 2017 12:11:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[0001-ftp-client-Allow-custom-username-and-password-for-FT.patch (text/x-patch, attachment)]
[0002-download-Handle-username-and-password-properties-for.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Dear guix,
These two patches enable the handling of usernames and passwords in a
FTP uri.
Kind regards,
Roel Janssen
Information forwarded
to
guix-patches <at> gnu.org
:
bug#26191
; Package
guix-patches
.
(Mon, 20 Mar 2017 19:11:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 26191 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Roel Janssen <roel <at> gnu.org> writes:
>>From e7263ce1d1a242f187c9801b14ea47043f59be8e Mon Sep 17 00:00:00 2001
> From: Roel Janssen <roel <at> gnu.org>
> Date: Mon, 20 Mar 2017 12:59:59 +0100
> Subject: [PATCH 2/2] download: Handle username and password properties for FTP
> uris.
>
> guix/build/download.scm (ftp-fetch): Process username and password from a URI.
> ---
> guix/build/download.scm | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/guix/build/download.scm b/guix/build/download.scm
> index 36c815c16..f48da7500 100644
> --- a/guix/build/download.scm
> +++ b/guix/build/download.scm
> @@ -241,7 +241,14 @@ and 'guix publish', something like
> (define* (ftp-fetch uri file #:key timeout)
> "Fetch data from URI and write it to FILE. Return FILE on success. Bail
> out if the connection could not be established in less than TIMEOUT seconds."
> - (let* ((conn (ftp-open (uri-host uri) #:timeout timeout))
> + (let* ((userinfo (string-split (uri-userinfo uri) #\:))
> + (username (if (and (> (length userinfo) 0)
> + (not (string= (car userinfo) "")))
> + (car userinfo) #f))
> + (password (if (> (length userinfo) 1) (cadr userinfo) #f))
> + (conn (ftp-open (uri-host uri) #:timeout timeout
> + #:username username
> + #:password password))
> (size (false-if-exception (ftp-size conn (uri-path uri))))
> (in (ftp-retr conn (basename (uri-path uri))
> (dirname (uri-path uri)))))
Hi Roel,
The code looks good and seems to work fine, but seeing that this is my
first time reviewing a patch to the "inner workings" of Guix, I'll defer
to the opinion of someone more experienced.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#26191
; Package
guix-patches
.
(Mon, 20 Mar 2017 19:46:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 26191 <at> debbugs.gnu.org (full text, mbox):
Hi Roel,
On Mon, 20 Mar 2017 13:10:08 +0100
Roel Janssen <roel <at> gnu.org> wrote:
> + (let* ((userinfo (string-split (uri-userinfo uri) #\:))
> + (username (if (and (> (length userinfo) 0)
> + (not (string= (car userinfo) "")))
> + (car userinfo) #f))
> + (password (if (> (length userinfo) 1) (cadr userinfo) #f))
It would make it more readable if you used (match ...).
Information forwarded
to
guix-patches <at> gnu.org
:
bug#26191
; Package
guix-patches
.
(Mon, 20 Mar 2017 20:32:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 26191 <at> debbugs.gnu.org (full text, mbox):
Roel Janssen <roel <at> gnu.org> skribis:
> From 8536ba69ec3a04930e8a78c8f2b824df3e8c0454 Mon Sep 17 00:00:00 2001
> From: Roel Janssen <roel <at> gnu.org>
> Date: Mon, 20 Mar 2017 12:57:25 +0100
> Subject: [PATCH 1/2] ftp-client: Allow custom username and password for FTP
> servers.
>
> * guix/ftp-client.scm (ftp-open): Add username and password arguments.
OK!
> From e7263ce1d1a242f187c9801b14ea47043f59be8e Mon Sep 17 00:00:00 2001
> From: Roel Janssen <roel <at> gnu.org>
> Date: Mon, 20 Mar 2017 12:59:59 +0100
> Subject: [PATCH 2/2] download: Handle username and password properties for FTP
> uris.
>
> guix/build/download.scm (ftp-fetch): Process username and password from a URI.
[...]
> + (let* ((userinfo (string-split (uri-userinfo uri) #\:))
> + (username (if (and (> (length userinfo) 0)
> + (not (string= (car userinfo) "")))
> + (car userinfo) #f))
> + (password (if (> (length userinfo) 1) (cadr userinfo) #f))
> + (conn (ftp-open (uri-host uri) #:timeout timeout
> + #:username username
> + #:password password))
Of course I have to agree with Danny here regarding ‘match’. ;-)
(let ((user (match userinfo
(() #f)
(("") #f)
(((? string? user)) user)))
(pass (match userinfo
…)))
…)
OK with a change along these lines.
Thank you!
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#26191
; Package
guix-patches
.
(Tue, 21 Mar 2017 08:53:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 26191 <at> debbugs.gnu.org (full text, mbox):
[0001-download-Handle-username-and-password-properties-for.patch (text/x-patch, attachment)]
[Message part 2 (text/plain, inline)]
Hello Danny and Ludo’,
Thanks for your quick responses and feedback!
Ludovic Courtès writes:
> Roel Janssen <roel <at> gnu.org> skribis:
>
>> From 8536ba69ec3a04930e8a78c8f2b824df3e8c0454 Mon Sep 17 00:00:00 2001
>> From: Roel Janssen <roel <at> gnu.org>
>> Date: Mon, 20 Mar 2017 12:57:25 +0100
>> Subject: [PATCH 1/2] ftp-client: Allow custom username and password for FTP
>> servers.
>>
>> * guix/ftp-client.scm (ftp-open): Add username and password arguments.
>
> OK!
>
>> From e7263ce1d1a242f187c9801b14ea47043f59be8e Mon Sep 17 00:00:00 2001
>> From: Roel Janssen <roel <at> gnu.org>
>> Date: Mon, 20 Mar 2017 12:59:59 +0100
>> Subject: [PATCH 2/2] download: Handle username and password properties for FTP
>> uris.
>>
>> guix/build/download.scm (ftp-fetch): Process username and password from a URI.
>
> [...]
>
>> + (let* ((userinfo (string-split (uri-userinfo uri) #\:))
>> + (username (if (and (> (length userinfo) 0)
>> + (not (string= (car userinfo) "")))
>> + (car userinfo) #f))
>> + (password (if (> (length userinfo) 1) (cadr userinfo) #f))
>> + (conn (ftp-open (uri-host uri) #:timeout timeout
>> + #:username username
>> + #:password password))
>
> Of course I have to agree with Danny here regarding ‘match’. ;-)
>
> (let ((user (match userinfo
> (() #f)
> (("") #f)
> (((? string? user)) user)))
> (pass (match userinfo
> …)))
> …)
>
> OK with a change along these lines.
I am unsure about this patch (see attached). Is this what you had in mind?
I would probably have to add a copyright line as well, right?
Thank you!
Kind regards,
Roel Janssen
Information forwarded
to
guix-patches <at> gnu.org
:
bug#26191
; Package
guix-patches
.
(Tue, 21 Mar 2017 10:51:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 26191 <at> debbugs.gnu.org (full text, mbox):
Hi Roel,
Roel Janssen <roel <at> gnu.org> skribis:
> Ludovic Courtès writes:
>
>> Roel Janssen <roel <at> gnu.org> skribis:
>>
>>> From 8536ba69ec3a04930e8a78c8f2b824df3e8c0454 Mon Sep 17 00:00:00 2001
>>> From: Roel Janssen <roel <at> gnu.org>
>>> Date: Mon, 20 Mar 2017 12:57:25 +0100
>>> Subject: [PATCH 1/2] ftp-client: Allow custom username and password for FTP
>>> servers.
>>>
>>> * guix/ftp-client.scm (ftp-open): Add username and password arguments.
>>
>> OK!
>>
>>> From e7263ce1d1a242f187c9801b14ea47043f59be8e Mon Sep 17 00:00:00 2001
>>> From: Roel Janssen <roel <at> gnu.org>
>>> Date: Mon, 20 Mar 2017 12:59:59 +0100
>>> Subject: [PATCH 2/2] download: Handle username and password properties for FTP
>>> uris.
>>>
>>> guix/build/download.scm (ftp-fetch): Process username and password from a URI.
>>
>> [...]
>>
>>> + (let* ((userinfo (string-split (uri-userinfo uri) #\:))
>>> + (username (if (and (> (length userinfo) 0)
>>> + (not (string= (car userinfo) "")))
>>> + (car userinfo) #f))
>>> + (password (if (> (length userinfo) 1) (cadr userinfo) #f))
>>> + (conn (ftp-open (uri-host uri) #:timeout timeout
>>> + #:username username
>>> + #:password password))
>>
>> Of course I have to agree with Danny here regarding ‘match’. ;-)
>>
>> (let ((user (match userinfo
>> (() #f)
>> (("") #f)
>> (((? string? user)) user)))
>> (pass (match userinfo
>> …)))
>> …)
>>
>> OK with a change along these lines.
>
> I am unsure about this patch (see attached). Is this what you had in mind?
> I would probably have to add a copyright line as well, right?
Yes, LGTM!
Thanks,
Ludo’.
Reply sent
to
Roel Janssen <roel <at> gnu.org>
:
You have taken responsibility.
(Tue, 21 Mar 2017 11:20:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Roel Janssen <roel <at> gnu.org>
:
bug acknowledged by developer.
(Tue, 21 Mar 2017 11:20:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 26191-done <at> debbugs.gnu.org (full text, mbox):
Ludovic Courtès writes:
> Hi Roel,
>
> Roel Janssen <roel <at> gnu.org> skribis:
>
>> Ludovic Courtès writes:
>>
>>> Roel Janssen <roel <at> gnu.org> skribis:
>>>
>>>> From 8536ba69ec3a04930e8a78c8f2b824df3e8c0454 Mon Sep 17 00:00:00 2001
>>>> From: Roel Janssen <roel <at> gnu.org>
>>>> Date: Mon, 20 Mar 2017 12:57:25 +0100
>>>> Subject: [PATCH 1/2] ftp-client: Allow custom username and password for FTP
>>>> servers.
>>>>
>>>> * guix/ftp-client.scm (ftp-open): Add username and password arguments.
>>>
>>> OK!
>>>
>>>> From e7263ce1d1a242f187c9801b14ea47043f59be8e Mon Sep 17 00:00:00 2001
>>>> From: Roel Janssen <roel <at> gnu.org>
>>>> Date: Mon, 20 Mar 2017 12:59:59 +0100
>>>> Subject: [PATCH 2/2] download: Handle username and password properties for FTP
>>>> uris.
>>>>
>>>> guix/build/download.scm (ftp-fetch): Process username and password from a URI.
>>>
>>> [...]
>>>
>>>> + (let* ((userinfo (string-split (uri-userinfo uri) #\:))
>>>> + (username (if (and (> (length userinfo) 0)
>>>> + (not (string= (car userinfo) "")))
>>>> + (car userinfo) #f))
>>>> + (password (if (> (length userinfo) 1) (cadr userinfo) #f))
>>>> + (conn (ftp-open (uri-host uri) #:timeout timeout
>>>> + #:username username
>>>> + #:password password))
>>>
>>> Of course I have to agree with Danny here regarding ‘match’. ;-)
>>>
>>> (let ((user (match userinfo
>>> (() #f)
>>> (("") #f)
>>> (((? string? user)) user)))
>>> (pass (match userinfo
>>> …)))
>>> …)
>>>
>>> OK with a change along these lines.
>>
>> I am unsure about this patch (see attached). Is this what you had in mind?
>> I would probably have to add a copyright line as well, right?
>
> Yes, LGTM!
Ok, thanks! I pushed the two patches.
Kind regards,
Roel Janssen
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 18 Apr 2017 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.