wiki:WikiStart/Toolchain/MultipleInstalls

This page briefly describes a workflow to develop using multiple Rock installations.

The 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.

A workflow to handle these is to do the following:

  • do NOT source any env.sh in your shell startup scripts (as e.g. .zshrc or .bashrc)
  • copy/paste the following shell snippet in your shell rc script (.zshrc, .bashrc). WARN: it is only tested for zsh.
function aenv()
{
  dir=$PWD
  while test "x$dir" != "x/"; do
    if test -f $dir/env.sh; then
      echo "sourcing $dir/env.sh"
      source $dir/env.sh
      break
    fi
    dir=`dirname $dir`
  done
  if test "x$dir" = "x/"; then
    echo "found no env.sh file to load"
  fi
}
aenv
  • 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.
  • if no env.sh were ever loaded in a shell, you can just cd in an autoproj installation and do
    aenv
    
  • if an env.sh is already loaded in a shell, you can cd in another autoproj installation and do (assuming your shell is bash)
    exec bash
    
Last modified 8 years ago Last modified on 10/21/11 17:34:57