better bb_ function

Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
This commit is contained in:
Gaetan Semet 2013-12-19 17:24:41 +01:00
commit f0f805d455

View file

@ -15,25 +15,26 @@ alias cjm='cactus jump metacactus'
function bb_env() function bb_env()
{ {
local BASE
BBDIR=$1 BBDIR=$1
shift shift
local BASE
if [[ -z $BBDIR ]]; then if [[ -z $BBDIR ]]; then
BASE=$BUILDBOT_PROJECT_PATH/main-new/ BASE=$BUILDBOT_PROJECT_PATH/main-new/
else else
BASE=$BBDIR BASE=$BBDIR
fi fi
#export __PATHBKP=$PATH # export __PATHBKP=$PATH
#export PYTHONPATH=$BASE/buildbot/master:$BASE/txwebservices/install:$BASE/cactus/install:$BASE/config/tools # export PYTHONPATH=$BASE/buildbot/master:$BASE/txwebservices/install:$BASE/cactus/install:$BASE/config/tools
#export PATH=$HOME/bin:$BASE/buildbot/master/bin:$BASE/txwebservices/install:$PATH # export PATH=$HOME/bin:$BASE/buildbot/master/bin:$BASE/txwebservices/install:$PATH
#export format_warnings_path=$BASE/config # export format_warnings_path=$BASE/config
#export warning_path=$BASE/config/latests_warnings # export warning_path=$BASE/config/latests_warnings
#export __PS1BKP=$PS1 # export __PS1BKP=$PS1
fg_blue=%{$'\e[0;34m'%} # fg_blue=%{$'\e[0;34m'%}
fg_cyan=%{$'\e[0;36m'%} # fg_cyan=%{$'\e[0;36m'%}
fg_lgreen=%{$'\e[1;32m'%} # fg_lgreen=%{$'\e[1;32m'%}
# export PS1=${fg_lgreen}BBENV${fg_cyan}:$PS1 # export PS1=${fg_lgreen}BBENV${fg_cyan}:$PS1
cd $BASE/config cd $BASE/config
@ -46,8 +47,9 @@ function bb_envrestore()
unset PYTHONPATH unset PYTHONPATH
unset warning_path unset warning_path
unset format_warnings_path unset format_warnings_path
export PATH=$__PATHBKP
export PS1=$__PS1BKP # export PATH=$__PATHBKP
# export PS1=$__PS1BKP
} }
alias autopep8_cur_directory='autopep8 --ignore=E501 -i **/*.py' alias autopep8_cur_directory='autopep8 --ignore=E501 -i **/*.py'
@ -67,16 +69,17 @@ function bb_repo_upload()
remy.protat@intel.com\ remy.protat@intel.com\
gaetan.semet@intel.com\ gaetan.semet@intel.com\
pierre.tardy@intel.com) pierre.tardy@intel.com)
A=$(printf -- '%s,' ${REVIEWERS[@]}) RE_LIST=$(printf -- '%s,' ${REVIEWERS[@]})
A=${A%,} RE_LIST=${RE_LIST%,}
echo "Reviewers: $A" echo "Reviewers: $RE_LIST"
echo "Cmd: repo upload --cbr --re=$A ." echo "Cmd: repo upload --cbr --re=$RE_LIST ."
yes | repo upload --cbr --re=$A . yes | repo upload --cbr --re=$RE_LIST .
} }
function bb_merge_bottom_branch_to_here() function bb_merge_bottom_branch_to_here()
{ {
local branch local branch
local bottom_branch
branch=$(git branches | grep "remotes/m/" | cut -d'/' -f5 | cut -d' ' -f1) branch=$(git branches | grep "remotes/m/" | cut -d'/' -f5 | cut -d' ' -f1)
case $branch in case $branch in
@ -92,7 +95,7 @@ function bb_merge_bottom_branch_to_here()
esac esac
echo "Merging branch $bottom_branch to $branch..." echo "Merging branch $bottom_branch to $branch..."
git merge umg/platform/buildbot/$bottom_branch --m "Manual merge of branch 'platform/buildbot/$bottom_branch' into 'platform/buildbot/$branch'" git merge umg/platform/buildbot/$bottom_branch --m "Manual merge of branch 'platform/buildbot/$bottom_branch' into 'platform/buildbot/$branch'"
git mergetool --no-prompt --tool=kdiff3 git mergetool --no-prompt
} }