Changes between Initial Version and Version 1 of WikiStart/Toolchain/MultipleInstalls


Ignore:
Timestamp:
10/21/11 17:34:57 (8 years ago)
Author:
sylvain.joyeux
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart/Toolchain/MultipleInstalls

    v1 v1  
     1This page briefly describes a workflow to develop using multiple Rock installations. 
     2 
     3The problem with having multiple Rock installations is to keep them isolated. If you source the env.sh from multiple installations, then it might happen that installation A uses files from installation B, for instance because package X is not (yet) installed in installation A. 
     4 
     5A workflow to handle these is to do the following: 
     6 
     7 * do NOT source any env.sh in your shell startup scripts (as e.g. .zshrc or .bashrc) 
     8 * copy/paste the following shell snippet in your shell rc script (.zshrc, .bashrc). WARN: it is only tested for zsh. 
     9 
     10{{{ 
     11function aenv() 
     12{ 
     13  dir=$PWD 
     14  while test "x$dir" != "x/"; do 
     15    if test -f $dir/env.sh; then 
     16      echo "sourcing $dir/env.sh" 
     17      source $dir/env.sh 
     18      break 
     19    fi 
     20    dir=`dirname $dir` 
     21  done 
     22  if test "x$dir" = "x/"; then 
     23    echo "found no env.sh file to load" 
     24  fi 
     25} 
     26aenv 
     27}}} 
     28 
     29  * after that, every time a shell is created a new directory, it will load the env.sh file of the current autoproj installation (if there is one). It means that if you open a new tab in your graphical terminal, and if that tab is in an autoproj installation, the right env.sh file gets loaded. 
     30  * if no env.sh were ever loaded in a shell, you can just cd in an autoproj installation and do 
     31{{{ 
     32aenv 
     33}}} 
     34  * if an env.sh is already loaded in a shell, you can cd in another autoproj installation and do (assuming your shell is bash) 
     35{{{ 
     36exec bash 
     37}}}