Re: [GUILT PATCH 2/5] guilt-guard: Assign guards to patches in series
- From
- Eric Lesh <eclesh@ucla.edu>
- Date
- Aug 9, 2007, 07:34 UTC
- Message-ID
- <87bqdhnotj.fsf@hubert.paunchy.net>
- In-Reply-To
- <20070731040510.GD12918@filer.fsl.cs.sunysb.edu>
[ I'm finally back to this. Thanks for your comments. ]
Josef Sipek <jsipek@fsl.cs.sunysb.edu> writes:
[...]
Show 9 quoted lines
>> +}
>> +
>> +# usage: set_guards <patch> <guards...>
>> +set_guards()
>> +{
>> + p="$1"
>
> Again, be careful about namespace polution.
>Can I use "local", or is it a bashism? If not, use parentheses around the function body?
Show 6 quoted lines
>> + shift >> + for x in "$@"; do >> + if [ -z $(printf %s "$x" | grep -e "^[+-]") ]; then > > Out of curiosity, why printf and not echo? >
For guards named '-e' or other funky things echo doesn't like and can't process with echo --.
Show 7 quoted lines
>> + echo "'$x' is not a valid guard name" >> + else >> + sed -i -e "s,^\($p[[:space:]]*.*\)$,\1 #$x," "$series" > > The regexp is in double quotes, so you should escape the $ (EOL), as well as > all the \. Yep, this is shell scripting at its worst. >
Yikes.
[...]
I'm trying to clean the rest and get it ready again. This whole series will definitely need to incubate for a while once there's a reasonable-looking version, to make sure nothing goes crazy. Hopefully it ends up being useful somewhere!
Eric