public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h
Date: Thu, 13 Aug 2009 10:28:09 -0500	[thread overview]
Message-ID: <4A843109.60609@freescale.com> (raw)
In-Reply-To: <200908130115.35378.vapier@gentoo.org>

Mike Frysinger wrote:
> On Friday 07 August 2009 15:22:15 Scott Wood wrote:
>> On Fri, Aug 07, 2009 at 09:03:03AM -0500, Kumar Gala wrote:
>>>  while [ $# -gt 0 ] ; do
>>>  	case "$1" in
>>>  	--) shift ; break ;;
>>>  	-a) shift ; APPEND=yes ;;
>>>  	-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
>>> +	-D) shift ; DEFINES="#define ${1/=/\t}\n"${DEFINES} ; shift ;;
>> How about something like:
>>
>> -D) shift ; DEFINES="${1//_/ } ${DEFINES}"; shift ;;
> 
> mkconfig's interpreter is /bin/sh, so if you want to use the string replace 
> bashism, you'll have to change it to /bin/bash.  or use the POSIX:
> "#define ${1%%=*}\t${1#*=}\n${DEFINES}"

Do you have a non-bash version of my alternative (which handles multiple 
symbols rather than one symbol/value pair per -D)?  Or do we need to 
invoke sed to be portable?

Or can we just use bash? :-)

-Scott

  reply	other threads:[~2009-08-13 15:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 14:03 [U-Boot] [PATCH] Add support to mkconfig for setting simple #defines in config.h Kumar Gala
2009-08-07 19:22 ` Scott Wood
2009-08-13  5:15   ` Mike Frysinger
2009-08-13 15:28     ` Scott Wood [this message]
2009-08-13 18:26       ` Mike Frysinger
2009-08-13 18:38         ` Scott Wood
2009-08-13 20:02           ` Mike Frysinger
2009-08-13 20:15             ` Wolfgang Denk
2009-08-13 20:23               ` Mike Frysinger
2009-08-13 22:01               ` Scott Wood

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=4A843109.60609@freescale.com \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox