Skip to content

Commit

Permalink
v9.8
Browse files Browse the repository at this point in the history
- META | DietPi-Survey_report: Work around current bug in bash's printf function. Use mawk for now: https://bugs.debian.org/1078556
  • Loading branch information
MichaIng committed Sep 1, 2024
1 parent a398cfc commit a01ce3a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ shopt -s extglob
eval "software=\${aSOFTWARE_NAME${version/./_}[$software]}"
if [[ ! $software ]]
then
echo "Invalid software ID for DietPi version $version"
echo "Invalid software ID \"$software\" for DietPi version $version"
mv -v "/home/dietpi-survey/survey/$file" /home/dietpi-survey/invalid/
return 1
fi
Expand Down Expand Up @@ -1005,9 +1005,12 @@ shopt -s extglob

# Work out averages
# - Divide CPU times by 100 and scale to revert decimal point removal
aBENCH_RESULT_CPU_MIN[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MIN[i]}e-2")
aBENCH_RESULT_CPU_MAX[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MAX[i]}e-2")
aBENCH_RESULT_CPU_AVG[i]=$(printf '%.2f' "$((${aBENCH_RESULT_CPU_AVG[i]}*10/${aBENCH_CPU_INDEX[i]}+1))e-3")
#aBENCH_RESULT_CPU_MIN[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MIN[i]}e-2")
#aBENCH_RESULT_CPU_MAX[i]=$(printf '%.2f' "${aBENCH_RESULT_CPU_MAX[i]}e-2")
#aBENCH_RESULT_CPU_AVG[i]=$(printf '%.2f' "$((${aBENCH_RESULT_CPU_AVG[i]}*10/${aBENCH_CPU_INDEX[i]}+1))e-3")
aBENCH_RESULT_CPU_MIN[i]=$(mawk "{printf \"%.2f\", ${aBENCH_RESULT_CPU_MIN[i]}e-2}" <<< '')
aBENCH_RESULT_CPU_MAX[i]=$(mawk "{printf \"%.2f\", ${aBENCH_RESULT_CPU_MAX[i]}e-2}" <<< '')
aBENCH_RESULT_CPU_AVG[i]=$(mawk "{printf \"%.2f\", $((${aBENCH_RESULT_CPU_AVG[i]}*10/${aBENCH_CPU_INDEX[i]}+1))e-3}" <<< '')

# CPU temps if available
aBENCH_RESULT_CPU_TEMP_START_MIN[i]='N/A'
Expand Down

0 comments on commit a01ce3a

Please sign in to comment.