From: Masahiro Yamada Date: Thu, 21 Aug 2014 11:47:10 +0900 Subject: [U-Boot] [PATCH] kconfig: convert Kconfig helper script into a shell script In-Reply-To: References: <1408240574-9936-1-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <20140821114709.2D63.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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