Capture queryview stderr and stdout in finalization scripts

Sometimes the output wasn't grep-able and this fixes it.

Ignore-AOSP-First: b/304316873#comment10

Test: Run the bazel query command multiple times before/after
      and verify it works 100% of the time after.
Bug: 320589170
Change-Id: Ic60d3318287353aa71fdeb2c540899d588a2d273
This commit is contained in:
Devin Moore
2024-01-17 16:47:11 +00:00
parent 196c1b5352
commit 395d5e32e2

View File

@@ -62,7 +62,7 @@ function create_new_compat_matrix() {
}" >> $bp_file
# get the previous kernel_configs properties and add them to the new module
local kernel_configs=$($top/out/host/linux-x86/bin/bazel query --config=queryview //hardware/interfaces/compatibility_matrices:"$current_bp_module"--android_common --output=build | grep kernel_configs | sed 's/[^\[]*\[\(.*\)],/\1/' | sed 's/ //g' | sed 's/\"//g')
local kernel_configs=$($top/out/host/linux-x86/bin/bazel query --config=queryview //hardware/interfaces/compatibility_matrices:"$current_bp_module"--android_common --output=build 2>$1 | grep kernel_configs | sed 's/[^\[]*\[\(.*\)],/\1/' | sed 's/ //g' | sed 's/\"//g')
$top/out/host/linux-x86/bin/bpmodify -m $final_bp_module -property kernel_configs -a $kernel_configs -w $bp_file