diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 50e18f3..b5e9897 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -45,7 +45,7 @@ squash_image_dir() { else mksquashfs "${1}" "${sq_img}" -noappend -comp ${iso_compression} ${highcomp} || die "Exit ..." fi - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer_start})" + show_elapsed_time "${FUNCNAME}" "${timer_start}" } run_xorriso(){ @@ -582,7 +582,7 @@ compress_images(){ make_iso make_checksum "${iso_file}" chown -R "${OWNER}:users" "${iso_dir}" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer_start})" + show_elapsed_time "${FUNCNAME}" "${timer_start}" } build_images(){ @@ -608,7 +608,7 @@ build_images(){ fi make_isolinux make_isomounts - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer_start})" + show_elapsed_time "${FUNCNAME}" "${timer_start}" } make_profile(){ @@ -633,5 +633,5 @@ make_profile(){ fi unset_profile msg "Finished building [%s]" "$1" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer_start})" + show_elapsed_time "${FUNCNAME}" "${timer_start}" } diff --git a/lib/util-pkg.sh b/lib/util-pkg.sh index 78f274f..b620521 100644 --- a/lib/util-pkg.sh +++ b/lib/util-pkg.sh @@ -155,7 +155,7 @@ chroot_init(){ else chroot_update fi - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer})" + show_elapsed_time "${FUNCNAME}" "${timer}" } make_pkg(){ @@ -166,7 +166,7 @@ make_pkg(){ run_post_build cd .. msg "Finished building [%s]" "$1" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer})" + show_elapsed_time "${FUNCNAME}" "${timer}" } pkgver_equal() { diff --git a/lib/util-pkgtree.sh b/lib/util-pkgtree.sh index 2fdfe00..4e8d53c 100644 --- a/lib/util-pkgtree.sh +++ b/lib/util-pkgtree.sh @@ -23,7 +23,7 @@ sync_tree(){ git pull origin master fi msg "Done [%s]" "$1" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer})" + show_elapsed_time "${FUNCNAME}" "${timer}" } clone_tree(){ @@ -32,7 +32,7 @@ clone_tree(){ msg3 "clone" git clone $2.git msg "Done [%s]" "$1" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer})" + show_elapsed_time "${FUNCNAME}" "${timer}" } sync_tree_manjaro(){ diff --git a/lib/util-publish.sh b/lib/util-publish.sh index 3ddf7b7..147d343 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -20,7 +20,7 @@ create_subtree(){ rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition}/$1/ rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition}/$1/${dist_release}/ msg2 "Done" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer_start})" + show_elapsed_time "${FUNCNAME}" "${timer_start}" } prepare_transfer(){ @@ -35,5 +35,5 @@ sync_dir(){ msg "Start upload [%s] (%s) ..." "$1" "${arch}" rsync ${rsync_args[*]} ${src_dir}/ ${sf_url}/${remote_dir}/ msg "Done upload [%s]" "$1" - msg3 "Time %s: %s minutes" "${FUNCNAME}" "$(elapsed_time ${timer_start})" + show_elapsed_time "${FUNCNAME}" "${timer_start}" } diff --git a/lib/util.sh b/lib/util.sh index bb7a667..66e9aa2 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -64,6 +64,10 @@ elapsed_time_ms(){ echo $(echo $1 $(get_timer_ms) | awk '{ printf "%0.3f",($2-$1)/1000 }') } +show_elapsed_time(){ + msg3 "Time %s: %s minutes" "$1" "$(elapsed_time $2)" +} + check_root() { (( EUID == 0 )) && return if type -P sudo >/dev/null; then @@ -398,7 +402,7 @@ kill_chroot_process(){ # this process is in the chroot... pid=$(basename $(dirname "$root_dir")) name=$(ps -p $pid -o comm=) - msg3 "Killing chroot process: $name ($pid)" + msg3 "Killing chroot process: %s (%s)" "$name" "$pid" kill -9 "$pid" fi fi