[Assorted-commits] SF.net SVN: assorted:[1469] shell-tools/trunk/src/bash-commons/bashrc.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-08-22 00:36:14
|
Revision: 1469 http://assorted.svn.sourceforge.net/assorted/?rev=1469&view=rev Author: yangzhang Date: 2009-08-22 00:35:57 +0000 (Sat, 22 Aug 2009) Log Message: ----------- pythonpath python version tweaks; added stoast; cleaner keychain/interactive setup Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2009-08-22 00:34:59 UTC (rev 1468) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2009-08-22 00:35:57 UTC (rev 1469) @@ -118,11 +118,12 @@ prepend_std INFOPATH info # TODO fix this to not use an explicit ruby version prepend_std RUBYLIB /var/lib/gems/1.8/lib -# i think: # - LD_LIBRARY_PATH is for dynamic shared libs # - LIBRARY_PATH is for gcc (static linking) prepend_std LD_LIBRARY_PATH lib /usr/local/lib prepend_std LIBRARY_PATH lib +# This is for pkg-config +prepend_std PKG_CONFIG_PATH lib/pkgconfig # Don't use CPATH for general system headers, since that gets treated as -I # instead of -isystem. prepend_var CPATH $HOME/.local/pkg/cpp-commons/include:/opt/cpp-commons/include @@ -149,7 +150,11 @@ export PYTHONSTARTUP="$HOME/.pythonrc.py" pythonpath_prepend= -for ver in 2.5 ; do # 2.4 ; do # 2.3 2.4 2.5 '' ; do +ver=${PYTHONVERSION} +if [[ ! "$ver" ]] && type python >& /dev/null +then ver="$( python -c 'import sys; print ".".join(map(str,sys.version_info[0:2]))' )" +fi +for ver in $ver ; do pythonpath_prepend="$USER_PREFIX/lib/python$ver/site-packages:$pythonpath_prepend" pythonpath_prepend="$USER_TOAST_PREFIX/lib/python$ver/site-packages:$pythonpath_prepend" pythonpath_prepend="/usr/local/lib/python$ver/site-packages:$pythonpath_prepend" @@ -697,6 +702,10 @@ "$@" } +stoast() { + sudo su - -c "toast $(quote "$@")" +} + #function set_title() { # if [ $# -eq 0 ] ; then # eval set -- "$PWD" @@ -737,15 +746,20 @@ # -t 1 checks if fd 1 (stdout) is a terminal; if so then we're running # interactively. +if [[ -t 1 ]] +then keychain_flags= +else keychain_flags=--noask +fi + +if have keychain +then eval `keychain --eval --nogui $keychain_flags id_dsa 2> /dev/null` +fi + +# TODO note that bash_completion usually does a ton of stuff (and in +# particular it re/undefines `have`), so it's best to move this near the +# top +# Note that this tends to be the most expensive part of my startup. if [[ -t 1 ]] ; then - if have keychain - then eval `keychain --eval --nogui id_dsa 2> /dev/null` - fi - - # TODO note that bash_completion usually does a ton of stuff (and in - # particular it re/undefines `have`), so it's best to move this near the - # top - # Note that this tends to be the most expensive part of my startup. if [[ -f /etc/bash_completion && -z "$BASH_COMPLETION" ]] then . /etc/bash_completion fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |