Firoz Khan wrote:
> +
> + my_abi="$(cut -d'|' -f2 <<< $my_abis)"
Here is the logic of identifying the generated script is for compat
interface
or not. So systbl_abi_syscall_table_c32 := common,compat,32 in Makefile
will parse the script and check the second string whether this is
"compat" or not.
Other ways are:
1. add an extra flag, that will again add the complexity
2. check if [ ${out: -5} = "c32.h" ], this looks weird
Is there any better way to do the same?
What part is that comment directed at? I guess it's the next hunk, so
I'll comment on that.
"<<<" is a bash extension and will not work with /bin/sh.
> + while read nr abi name entry compat ; do
> + if [ $my_abi = "compat" ]; then
> + if [ -z "$compat" ]; then
> + emit $nxt $nr $entry
> + else
> + emit $nxt $nr $compat
> + fi
> + else
> + emit $nxt $nr $entry
> + fi
I would go for a local variable being set to $compat or $entry and
calling emit at only one place. And there should be only one if with 2
expressions, no need for 3 branches.
if [ $my_abi = "compat" -a -n "${compat}" ]; then
somevar=${compat}
else
somevar=${entry}
fi
emit $nxt $nr $somevar
Eike