Merge pull request #166827 from Artturin/addtimeprint
This commit is contained in:
commit
e2166cd22b
1 changed files with 23 additions and 0 deletions
|
@ -1305,6 +1305,23 @@ showPhaseHeader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
showPhaseFooter() {
|
||||||
|
local phase="$1"
|
||||||
|
local startTime="$2"
|
||||||
|
local endTime="$3"
|
||||||
|
local delta=$(( endTime - startTime ))
|
||||||
|
(( $delta < 30 )) && return
|
||||||
|
|
||||||
|
local H=$((delta/3600))
|
||||||
|
local M=$((delta%3600/60))
|
||||||
|
local S=$((delta%60))
|
||||||
|
echo -n "$phase completed in "
|
||||||
|
(( $H > 0 )) && echo -n "$H hours "
|
||||||
|
(( $M > 0 )) && echo -n "$M minutes "
|
||||||
|
echo "$S seconds"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
genericBuild() {
|
genericBuild() {
|
||||||
if [ -f "${buildCommandPath:-}" ]; then
|
if [ -f "${buildCommandPath:-}" ]; then
|
||||||
source "$buildCommandPath"
|
source "$buildCommandPath"
|
||||||
|
@ -1340,10 +1357,16 @@ genericBuild() {
|
||||||
showPhaseHeader "$curPhase"
|
showPhaseHeader "$curPhase"
|
||||||
dumpVars
|
dumpVars
|
||||||
|
|
||||||
|
local startTime=$(date +"%s")
|
||||||
|
|
||||||
# Evaluate the variable named $curPhase if it exists, otherwise the
|
# Evaluate the variable named $curPhase if it exists, otherwise the
|
||||||
# function named $curPhase.
|
# function named $curPhase.
|
||||||
eval "${!curPhase:-$curPhase}"
|
eval "${!curPhase:-$curPhase}"
|
||||||
|
|
||||||
|
local endTime=$(date +"%s")
|
||||||
|
|
||||||
|
showPhaseFooter "$curPhase" "$startTime" "$endTime"
|
||||||
|
|
||||||
if [ "$curPhase" = unpackPhase ]; then
|
if [ "$curPhase" = unpackPhase ]; then
|
||||||
# make sure we can cd into the directory
|
# make sure we can cd into the directory
|
||||||
[ -z "${sourceRoot}" ] || chmod +x "${sourceRoot}"
|
[ -z "${sourceRoot}" ] || chmod +x "${sourceRoot}"
|
||||||
|
|
Loading…
Reference in a new issue