From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: "Andreas Färber" <afaerber-l3A5Bk7waGM@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [flasher PATCH 2/2] Wrap any env var settings in quotes
Date: Wed, 02 Jul 2014 12:46:01 -0600 [thread overview]
Message-ID: <53B45369.8090506@wwwdotorg.org> (raw)
In-Reply-To: <53B45286.9050408-l3A5Bk7waGM@public.gmane.org>
On 07/02/2014 12:42 PM, Andreas Färber wrote:
> Hi,
>
> Am 02.07.2014 19:32, schrieb Stephen Warren:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> This allows run user to pass the following to the flashing script:
>
> Is "run user" a typo?
s/run/the/ !
>> --env bootcmd 'usb start ; dhcp zImage'
>>
>> rather than having to manually escape the commands for U-Boot:
>>
>> --env bootcmd 'usb start \; dhcp zImage'
>> diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher
>> if args.env:
>> for (var, value) in args.env:
>> - bootcmd += 'setenv %s %s ; ' % (var, value)
>> + bootcmd += 'setenv %s \'%s\' ; ' % (var, value)
>
> Can't you just s/'/\\\'/g on value somehow, i.e. replace literal
> single-quote with an escaped backslash, escaped single-quote sequence?
I tried that manually at the command-line, and U-Boot's shell doesn't
seem to handle escaping quotes correctly. Escaped semicolons (which was
what I actually wanted to avoid writing manually) do work OK, but it's
simpler to just quote the whole thing rather than writing ever more
complicated parsers to quote certain characters or not based on whether
they're inside strings or not, etc. It'd be nice if U-Boot's setenv
could work like:
setenv -hex varname hex_encoded_value
... to completely avoid any quoting issues!
next prev parent reply other threads:[~2014-07-02 18:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-02 17:32 [flasher PATCH 1/2] Switch flasher script to subprocess Stephen Warren
[not found] ` <1404322363-11580-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-02 17:32 ` [flasher PATCH 2/2] Wrap any env var settings in quotes Stephen Warren
[not found] ` <1404322363-11580-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-02 18:42 ` Andreas Färber
[not found] ` <53B45286.9050408-l3A5Bk7waGM@public.gmane.org>
2014-07-02 18:46 ` Stephen Warren [this message]
2014-07-02 23:18 ` [flasher PATCH 1/2] Switch flasher script to subprocess Stephen Warren
[not found] ` <CA+G9XgdAAMttS66oscdY15jUns+ojOJ4-ny0eRfFYO6PXBNXCg@mail.gmail.com>
[not found] ` <CA+G9XgdAAMttS66oscdY15jUns+ojOJ4-ny0eRfFYO6PXBNXCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-21 15:42 ` Stephen Warren
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=53B45369.8090506@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=afaerber-l3A5Bk7waGM@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
/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.
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.