[PATCH 2/3] maint: add script to generate decoders from definitions

Srikavin Ramkumar srikavinramkumar at gmail.com
Mon Aug 30 22:18:31 UTC 2021


On Mon Aug 30, 2021 at 6:18 AM EDT, Dmitry V. Levin wrote:
> On Sat, Aug 21, 2021 at 09:51:58AM -0400, Srikavin Ramkumar wrote:
> > * maint/gen/generate.in: New file.
> > * maint/gen/generate.sh: Likewise.
> > ---
> > [...]
> > +
> > +while IFS="$(printf '\t')" read in out; do
> > +	echo "generating ../../src/gen/gen_$out"
> > +	./gen "$in" "../../src/gen/gen_$out"
> > +done < generate.in
>
> Thanks, this definitely works, just a few comments.
>
> Let's have a make target instead of invoking "make" in the script,
> maybe even make it the default target.

Sure, the Makefile already has the default target 'all', that I can invoke 
explicitly in this script.

> ../../src/gen is used several times in the script,
> maybe introduce a variable?

I'll introduce a variable similar to OUTPUT_PATH.

> I don't see why you use IFS= here, is it really needed?

It's not needed; I didn't realize the default field separator included tabs.

> At the same time, in other scripts of this nature we use "read -r",
> maybe it should be used here as well.
>
> In other scripts similar "generating diagnostics" is printed to stderr,
> maybe this script should do the same.

I'll make these changes as well, and send in a v2.

>
> --
> ldv



More information about the Strace-devel mailing list