From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: ng0 <ng0@libertad.pw>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: curl: Add ca-bundle to config.
Date: Thu, 5 Jan 2017 16:24:14 +0100 [thread overview]
Message-ID: <idjinptsf6p.fsf@bimsb-sys02.mdc-berlin.net> (raw)
In-Reply-To: <8737gyoi1r.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me>
ng0 <ng0@libertad.pw> writes:
>> how can I make this valid:
>>
>> (arguments
>> `(#:configure-flags '("--enable-ipv6" "--with-gnutls" "--without-libssh2"
>> "--without-libmetalink" "--without-winidn"
>> "--without-librtmp" "--without-nghttp2"
>> "--without-nss" "--without-cyassl"
>> "--without-polarssl" "--without-ssl"
>> "--without-winssl" "--without-darwinssl"
>> "--disable-sspi" "--disable-ntlm-wb"
>> "--disable-ldap" "--disable-rtsp" "--disable-dict"
>> "--disable-telnet" "--disable-tftp" "--disable-pop3"
>> "--disable-imap" "--disable-smtp" "--disable-gopher"
>> "--disable-file" "--disable-ftp" "--disable-smb"
>> (string-append
>> "--with-ca-bundle="
>> (string-append (assoc-ref %build-inputs "nss-certs")
>> "/etc/ssl/certs/ca-certificates.crt")))
>>
>> The string-append is not valid here.
>
> Solved, by using "(list" here.
The reason why this didn’t work is because you’re expecting code to be
evaluated inside of an “inert” expression.
(+ 1 2) is evaluated right away and the result is 3
'(+ 1 2) is a quoted expression, so it’s just a list of '+, 1, and 2.
Think of the ' as “DATA MODE”
`(+ 1 2) is a quasiquoted expression. Think of the backtick as a toggle
switch. When it’s up it means “DATA MODE”, when it is down (,) it means
“CODE MODE”.
Example:
`(+ 1 2 ,(string->number "4"))
this means: DATA MODE + 1 2 CODE MODE (string->number "4")
so you get a list with the following contents: '+, 1, 2, and the number 4.
Your configure flags above are a quoted list, so everything that follows
is just data. “string-append” is not special, it’s just another symbol
in the list. You can try this in the REPL to convince yourself that
this is how quoting works.
Note the difference between:
`(#:configure-flags '("foo" "bar"
(string-append "baz" "lightyear")))
and
`(#:configure-flags '("foo" "bar"
,(string-append "baz" "lightyear")))
The comma (“unquote”) flips the toggle switch and the expression is
evaluated.
Using “list” just means that you are not using quotation at all.
One final note:
>> (string-append
>> "--with-ca-bundle="
>> (string-append (assoc-ref %build-inputs "nss-certs")
>> "/etc/ssl/certs/ca-certificates.crt")))
That’s really not pretty. You don’t need to nest string-append
expressions.
(string-append "this" "and" "that")
returns the same value as
(string-append "this" (string-append "and" "that"))
~~ Ricardo
next prev parent reply other threads:[~2017-01-05 15:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 14:46 PATCH as first attempt to fix the sad curl situation ng0
2017-01-04 14:46 ` [PATCH] gnu: curl: Add ca-bundle to config ng0
2017-01-04 16:00 ` Marius Bakke
2017-01-04 16:37 ` Marius Bakke
2017-01-04 17:07 ` ng0
2017-01-04 17:16 ` ng0
2017-01-04 17:23 ` ng0
2017-01-05 15:24 ` Ricardo Wurmus [this message]
2017-01-04 20:40 ` GnuTLS and the “trust store” Ludovic Courtès
2017-01-04 22:09 ` ng0
2017-01-05 10:28 ` Ludovic Courtès
2017-01-05 15:12 ` Ricardo Wurmus
2017-01-05 14:11 ` Marius Bakke
2017-01-05 15:08 ` Ricardo Wurmus
2017-01-05 23:10 ` Ludovic Courtès
2017-01-06 14:20 ` Ricardo Wurmus
2017-01-07 21:12 ` Ludovic Courtès
2017-01-04 14:48 ` PATCH as first attempt to fix the sad curl situation ng0
2017-01-04 17:56 ` Ricardo Wurmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=idjinptsf6p.fsf@bimsb-sys02.mdc-berlin.net \
--to=ricardo.wurmus@mdc-berlin.de \
--cc=guix-devel@gnu.org \
--cc=ng0@libertad.pw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.