summaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-05-29 15:22:22 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2017-05-29 15:22:22 +0100
commit56eea501412d320a99840356a00cf072c41ee225 (patch)
tree78b6e39e94c395445a41dcdde408562575d21cb2 /bashrc
parentEnable ccache (diff)
downloadutil-56eea501412d320a99840356a00cf072c41ee225.tar.bz2
util-56eea501412d320a99840356a00cf072c41ee225.tar.xz
util-56eea501412d320a99840356a00cf072c41ee225.zip
Build aliases to function
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc27
1 files changed, 25 insertions, 2 deletions
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() {