Patchwork [kteam-tools,v2] git-build-kernel: pretty elapsed build-time/loadavg banner

login
register
mail settings
Submitter Kamal Mostafa
Date Aug. 8, 2013, 5:19 p.m.
Message ID <1375982371-7373-1-git-send-email-kamal@canonical.com>
Download mbox | patch
Permalink /patch/265788/
State New
Headers show

Comments

Kamal Mostafa - Aug. 8, 2013, 5:19 p.m.
PATCH v2:  Identical code, but description changed to reflect only the
cosmetic result.  If it happens to cure some timeout, then that's just
dumb luck ;-)

 -Kamal

-------------------- >8 --------------------
Displays a pretty elapsed build-time and system load average banner,
updated every 11 seconds.

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 git-build-kernel/git-build-kernel | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
Brad Figg - Aug. 8, 2013, 7:16 p.m.
On 08/08/2013 10:19 AM, Kamal Mostafa wrote:
> PATCH v2:  Identical code, but description changed to reflect only the
> cosmetic result.  If it happens to cure some timeout, then that's just
> dumb luck ;-)
> 
>  -Kamal
> 
> -------------------- >8 --------------------
> Displays a pretty elapsed build-time and system load average banner,
> updated every 11 seconds.
> 
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  git-build-kernel/git-build-kernel | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index df01673..a62d00c 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -94,7 +94,8 @@ mkdir "$WORKDIR" || exit
>  
>  BUILDDIR="$WORKDIR/build"
>  LOG="$WORKDIR/build.log"
> -trap "rm -rf $BUILDDIR" 0
> +touch "$WORKDIR/building"
> +trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
>      orig_tarball="linux_${VERSION%%-*}.orig.tar.gz"
> @@ -116,6 +117,19 @@ echo "      version: $DISTRO ($VERSION)"
>  echo "      targets: $TARGETS"
>  echo "  starting build in $HOSTNAME:$WORKDIR ..."
>  
> +function show_elapsed
> +{
> +	while [ -f $WORKDIR/building ]
> +	do
> +	    loadavg="`uptime`"
> +	    loadavg="load${loadavg##*load}"
> +	    elapsed=`date --utc --date="@$SECONDS" +%H:%M:%S`
> +	    echo -n -e "\r  elapsed: $elapsed   $loadavg"
> +	    sleep 11
> +	done
> +}
> +show_elapsed &
> +
>  (
>  	set -e
>  	echo "+++gbk++++ git-build-kernel"
> @@ -146,6 +160,8 @@ XXEOFXX
>  ) > $LOG 2>&1
>  STATUS=$?
>  
> +rm -f "$WORKDIR/building"
> +echo
>  
>  ### Output information about the build status and products
>  
>
Steve Conklin - Aug. 12, 2013, 2:54 p.m.
On 08/08/2013 12:19 PM, Kamal Mostafa wrote:
> PATCH v2:  Identical code, but description changed to reflect only the
> cosmetic result.  If it happens to cure some timeout, then that's just
> dumb luck ;-)
> 
>  -Kamal
> 
> -------------------- >8 --------------------
> Displays a pretty elapsed build-time and system load average banner,
> updated every 11 seconds.
> 
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  git-build-kernel/git-build-kernel | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
> index df01673..a62d00c 100755
> --- a/git-build-kernel/git-build-kernel
> +++ b/git-build-kernel/git-build-kernel
> @@ -94,7 +94,8 @@ mkdir "$WORKDIR" || exit
>  
>  BUILDDIR="$WORKDIR/build"
>  LOG="$WORKDIR/build.log"
> -trap "rm -rf $BUILDDIR" 0
> +touch "$WORKDIR/building"
> +trap "rm -rf $WORKDIR/building $BUILDDIR" 0
>  
>  [ $do_source_pkg = 1 ] && {
>      orig_tarball="linux_${VERSION%%-*}.orig.tar.gz"
> @@ -116,6 +117,19 @@ echo "      version: $DISTRO ($VERSION)"
>  echo "      targets: $TARGETS"
>  echo "  starting build in $HOSTNAME:$WORKDIR ..."
>  
> +function show_elapsed
> +{
> +	while [ -f $WORKDIR/building ]
> +	do
> +	    loadavg="`uptime`"
> +	    loadavg="load${loadavg##*load}"
> +	    elapsed=`date --utc --date="@$SECONDS" +%H:%M:%S`
> +	    echo -n -e "\r  elapsed: $elapsed   $loadavg"
> +	    sleep 11
> +	done
> +}
> +show_elapsed &
> +
>  (
>  	set -e
>  	echo "+++gbk++++ git-build-kernel"
> @@ -146,6 +160,8 @@ XXEOFXX
>  ) > $LOG 2>&1
>  STATUS=$?
>  
> +rm -f "$WORKDIR/building"
> +echo
>  
>  ### Output information about the build status and products
>  
>
Andy Whitcroft - Aug. 13, 2013, 9:17 a.m.
On Thu, Aug 08, 2013 at 10:19:31AM -0700, Kamal Mostafa wrote:
> PATCH v2:  Identical code, but description changed to reflect only the
> cosmetic result.  If it happens to cure some timeout, then that's just
> dumb luck ;-)

Seemingly already applied.

-apw

Patch

diff --git a/git-build-kernel/git-build-kernel b/git-build-kernel/git-build-kernel
index df01673..a62d00c 100755
--- a/git-build-kernel/git-build-kernel
+++ b/git-build-kernel/git-build-kernel
@@ -94,7 +94,8 @@  mkdir "$WORKDIR" || exit
 
 BUILDDIR="$WORKDIR/build"
 LOG="$WORKDIR/build.log"
-trap "rm -rf $BUILDDIR" 0
+touch "$WORKDIR/building"
+trap "rm -rf $WORKDIR/building $BUILDDIR" 0
 
 [ $do_source_pkg = 1 ] && {
     orig_tarball="linux_${VERSION%%-*}.orig.tar.gz"
@@ -116,6 +117,19 @@  echo "      version: $DISTRO ($VERSION)"
 echo "      targets: $TARGETS"
 echo "  starting build in $HOSTNAME:$WORKDIR ..."
 
+function show_elapsed
+{
+	while [ -f $WORKDIR/building ]
+	do
+	    loadavg="`uptime`"
+	    loadavg="load${loadavg##*load}"
+	    elapsed=`date --utc --date="@$SECONDS" +%H:%M:%S`
+	    echo -n -e "\r  elapsed: $elapsed   $loadavg"
+	    sleep 11
+	done
+}
+show_elapsed &
+
 (
 	set -e
 	echo "+++gbk++++ git-build-kernel"
@@ -146,6 +160,8 @@  XXEOFXX
 ) > $LOG 2>&1
 STATUS=$?
 
+rm -f "$WORKDIR/building"
+echo
 
 ### Output information about the build status and products