We already do this in hack/verify-generated-files.sh so we should do it
in verify-generated-files-remake.sh as well.
The idea is that any local changes made because of code generation
should not persist beyond the current run of the script.
Change-Id: I7af176773ae16c393dc2b46c006595243c9fa05b
'read' will not handle backslashes properly. 'read -r' is safer to use.
The find_genfiles() will not insert backslashes, so if there are any,
they will be from directory names.
The pattern used in the file is this:
echo " ${X[@]:-(none)}"
What happens is that the array is expanded to separate strings, and it
is checked if that's set (for the default value assignment). However,
the correct way is to check if the concatenated array string is set to
avoid a type mismatch:
echo " ${X[*]:-(none)}"
Tests show that at least bash 4.4.23 behaves the same:
X=(foo bar)
echo " ${X[@]:-(none)}"
echo " ${X[*]:-(none)}"
X=()
echo " ${X[@]:-(none)}"
echo " ${X[*]:-(none)}"
produces:
foo bar
foo bar
(none)
(none)
check in existing API rule violations;
the Make rule fails if generated violation report differs from the
checked-in violation file and prints error message;
add documentation.