From 56eea501412d320a99840356a00cf072c41ee225 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 29 May 2017 15:22:22 +0100 Subject: Build aliases to function --- bashrc | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'bashrc') diff --git a/bashrc b/bashrc index c4669f9..9cb85cf 100644 --- a/bashrc +++ b/bashrc @@ -48,8 +48,31 @@ alias ChuckNorris="sudo" alias l="/bin/ls -lhvF --color" alias grep="/bin/grep -I --color=auto --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.svn --exclude-dir=bin --exclude=tags --exclude-dir=docs/html" alias emerge-state='watch "( ps -fC sandbox ; tail /var/log/emerge.log /var/tmp/portage/*/*/temp/build.log 2> /dev/null )"' -alias build='b2 -j$CORES $TARGET' -alias autobuild="build ; while inotifywait -qr . --exclude '/bin/|\.sw.|/\.git/' -e modify ; do clear ; printf '\e[3J' ; build ; done" +title() { + echo -ne "\033]0;$@\007" +} +build() { + title "Build in progress" + CCACHE_BASEDIR=$(git root) nice -n5 b2 -j$CORES $@ + rtn=$? + if [ $rtn -eq 0 ]; then + title "Build success ${PWD/#$HOME/\~}" + else + title "Build failed ${PWD/#$HOME/\~}" + fi + return $rtn +} +onchange() { + $@ + while inotifywait -qr . --exclude '/bin/|\.sw.|/target/|/\.git/|\.gcov' -e modify ; do + clear + printf '\e[3J' + $@ + done +} +autobuild() { + onchange build $@ +} # CVS export CVSROOT=":pserver:danielg@hawking.howden.press.net:/usr/local/src/CVS_SOURCE_TREE" cvsd() { -- cgit v1.2.3