lkml.org 
[lkml]   [2009]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] kbuild: handle non-existing options in scripts/config
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


\
 
 \ /
  Last update: 2009-05-25 15:23    [W:0.137 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site