[U-Boot] [PATCH] kconfig: convert Kconfig helper script into a shell script
Masahiro Yamada
yamada.m at jp.panasonic.com
Thu Aug 21 04:47:10 CEST 2014
Hi Simon.
Thanks for your review!
I have posted v3 (only comments updates).
And some comments below:
On Wed, 20 Aug 2014 12:43:22 -0600
Simon Glass <sjg at chromium.org> wrote:
> > +
> > + sed -n -e 's/^CONFIG_\(SPL\|TPL\)=y$/\1/p' $KCONFIG_CONFIG | \
> > + tr '[A-Z]' '[a-z]'
>
> Can you add a short comment on this command?
I added comments to all the parts you mentioned.
> > +
> > +cleanup_after_defconfig () {
> > + rm -f configs/.tmp_defconfig
> > + # ignore 'Directory not empty' error without using non-POSIX option
> > + # '--ignore-fail-on-non-empty'
> > + rmdir arch configs 2>/dev/null || true
>
> Could perhaps do something like:
>
> [ "$(ls -A arch)" ] && rmdir arch
>
> But what you have seems OK too and is nicely commented.
>
It also works.
But "ls -A arch" fails if arch does not exist.
(Actually it does. But just in case
[ -d arch ] && [ "$(ls -A arch)" ] && rmdir arch
it is a bit long.)
Nor am I happy about writing two lines
[ "$(ls -A arch)" ] && rmdir arch
[ "$(ls -A configs)" ] && rmdir configs
I am keeping this part untouched.
> > + # -r option is necessay because some string-type configs may include
> > + # backslashes as an escape character
> > + while read -r line
> > + do
> > + output_lines="$output_lines $line"
>
> Are there any limitations on the size of shell variables? Will this
> bite us in future?
I do not know the exact upper limit,
but I guess it is big enough.
I tested on some defconfigs in Linux (more than 450 lines)
and it worked well.
I think it won't be a problem at least for our normal operation.
Best Regards
Masahiro Yamada
More information about the U-Boot
mailing list