aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Labastie <pierre.labastie@neuf.fr>2022-02-17 23:53:51 +0100
committerPierre Labastie <pierre.labastie@neuf.fr>2022-02-17 23:53:51 +0100
commit0f3b1c317c1a57bd260a8ebf830bbca5c3b5449a (patch)
tree0349fdee23af4a0da47fef4305de27405fc6fa45
parent2e3565363048fddebaa69cc6b96d8a0015e2cffe (diff)
create-sbu_du-report.sh: check that J_VALUE is never empty
-rwxr-xr-xcommon/create-sbu_du-report.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/create-sbu_du-report.sh b/common/create-sbu_du-report.sh
index 460e4aa5ee..fc8ddd79a9 100755
--- a/common/create-sbu_du-report.sh
+++ b/common/create-sbu_du-report.sh
@@ -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"