]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Display taken time in format <minutes>:<seconds>.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Apr 2009 07:48:00 +0000 (09:48 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Apr 2009 07:48:00 +0000 (09:48 +0200)
tools/make-beautify

index 9713d348056e5dbc07472e85d4daf54008de0605..127d086b6aa6009502cd7de648b0e36e45083742 100644 (file)
@@ -144,7 +144,7 @@ beautify() {
                build_stage)
                        MESSAGE=$2
                        echo -ne "${BOLD}*** ${MESSAGE}${SET_OPT_COL}  options${SET_VER_COL}     version "
-                       echo -ne "${SET_TIME_COL} time (sec)${SET_RESULT_COL} status${NORMAL}\n"
+                       echo -ne "${SET_TIME_COL}    time    ${SET_RESULT_COL} status${NORMAL}\n"
                        ;;
                package)
                        local PKG_NAME=$2
@@ -174,6 +174,9 @@ beautify() {
                                PKG_TIME=$3
                        fi
 
+                       # If time is lager than one minute display it like this: <minutes>:<seconds>, e.g. 1:16
+                       [ $PKG_TIME -ge 60 ] && PKG_TIME=$(printf "%d:%02d" $[ $PKG_TIME / 60 ] $[ $PKG_TIME % 60 ])
+
                        SET_TIME_COL_REAL=`position_cursor $RESULT_COL $PKG_TIME -3`
                        echo -ne "${SET_TIME_COL}${BRACKET_L} ${BOLD}${SET_TIME_COL_REAL}$PKG_TIME${NORMAL} ${BRACKET_R}"
                        case "$RESULT" in