All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Andi Kleen <andi@firstfloor.org>
Cc: Sam Ravnborg <sam@ravnborg.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] kbuild: handle non-existing options in scripts/config
Date: Mon, 25 May 2009 15:21:11 +0200	[thread overview]
Message-ID: <4A1A9B47.2090208@suse.cz> (raw)
In-Reply-To: <20090525131144.GZ846@one.firstfloor.org>

Andi Kleen napsal(a):
>> -replace() {
>> -	sed -i -e "$@" $FN
>> +# set_var name value [before-var]
>> +set_var() {
>> +	awk -vvar="$1" -vnew="$2" -vbefore="$3" '
> 
> This seems rather complicated compared to what was there before.

Calling the function is simpler otoh...


> I would just cmp the output file to the input file and if they are
> the same then add it at the end with a echo

Just doing that would duplicate the variable if it was already set to
the desired value, causing a "warning: override: reassigning to symbol"
warning from kbuild.

Hmm, willll try to simplify it somehow.


> 
>> +	}
>> +	' "$FN" >"$FN.tmp"
> 
> This should be a &&, otherwise you risk removing the output file
> on ctrl-c

Ah, good point.

Michal

  reply	other threads:[~2009-05-25 13:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1243255664.git.mmarek@suse.cz>
2009-05-25 12:55 ` [PATCH 1/3] kbuild: handle non-existing options in scripts/config Michal Marek
2009-05-25 13:11   ` Andi Kleen
2009-05-25 13:21     ` Michal Marek [this message]
2009-05-25 12:55 ` [PATCH 2/3] kbuild: simplify argument loop " Michal Marek
2009-05-25 12:55 ` [PATCH 3/3] kbuild: add generic --set option to scripts/config Michal Marek
2009-05-25 13:13   ` Andi Kleen
2009-05-25 13:25     ` Michal Marek
     [not found] <cover.1243262102.git.mmarek@suse.cz>
2009-05-25 14:43 ` [PATCH 1/3] kbuild: handle non-existing options in scripts/config Michal Marek

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=4A1A9B47.2090208@suse.cz \
    --to=mmarek@suse.cz \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.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.