create-sbu_du-report.sh: check that J_VALUE is never empty

This commit is contained in:
Pierre Labastie 2022-02-17 23:53:51 +01:00
parent 2e35653630
commit 0f3b1c317c

View file

@ -64,6 +64,9 @@ if [ $(sed -n '/REALSBU/s/.*\([yn]\).*/\1/p' "$REPORT") = y ]; then
else
J_VALUE=$(sed -n '/N_PARALLEL/s/.*<\([^>]*\).*/\1/p' "$REPORT")
fi
# if jhalfs.config does not exist, or OPTIMIZE is 0, then J_VALUE is
# still empty. Assume 1 in that case
if [ -z "$J_VALUE" ]; then J_VALUE=1; fi
echo -e "\nThe SBU unit value is equal to $SBU_UNIT seconds at -j$J_VALUE.\n"
echo -e "\n\n$LINE\n\nThe SBU unit value is equal to $SBU_UNIT seconds at -j$J_VALUE.\n" >> "$REPORT"