Without digging into kconfig to see exactly what's going on, I'm
afraid that anyone using risky characters (especially ['`\n#$]) in one
of these fields is on their own.
Single-quoted strings appear to be interpreted as empty regardless of
their content, so that's not an option. Within double-quoted strings,
it doesn't appear to allow you to escape single-quotes, quisi-quotes,
or #comments. While double-quotes and backslashes only need a single
escape (which does line up with object->string), (semi-)colons need
two, and a pipe only works with four ("\\\\\\\\|" in a guile source
file). "$" breaks in ways that I frankly don't understand, and which
no amount of escaping resolves. I'm perfectly content to assume that
people will only use [a-zA-Z0-9/+-_. ], and [[\]!@%^&*()={},<>?] also
happen to work just fine.
Thanks for taking the time to review my patch, and for all the work
you've done, within Guix and the broader Guile ecosystem alike.
On Tue, Apr 5, 2022 at 11:18 AM Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (31 lines)
> antlers <autumnalantlers@gmail.com> skribis:
> > * gnu/packages/linux.scm (config->string): add a clause handling strings
> > Allows for the declarative configuration of kconfig options which accept
> > strings, such as CONFIG_MODULE_SIG_KEY.
> > I've enclosed the given string in quotes, but don't do any kind of
> > escaping. See the kernel mailing list for the current state of escaped
> > https://patchwork.kernel.org/project/linux-kbuild/patch/1431003982-992-1-git-send-email-sr@denx.de/
> > Apologies to those with double-quotes or backslashes in their
> > CONFIG_SYSTEM_*_KEYS.
> If needed, a cheap and often “good enough” way to escape strings is
> (display (object->string "foo\"bar\"baz"))