One source command overwriting another

asked 2016-10-14 09:05:25 -0500

Hakaishin gravatar image

I had the problem, that my rviz had this bug. I reinstalled it with sudo apt-get --reinstall and it worked afterwards. But during this process it somehow fucked up my workspace. I have these two lines in my .bashrc

source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash

Now the later overwrites the first one and if I change the order the same happens. This didn't happen before. I could do

rosrun rviz rviz

and

roscd 'some_package_in_my_workspace'

but now I can only do one or the other and if I want to do the other for example for

rosrun rviz rviz

I have to source my /opt/indigo and for roscd I have to source my workspace. How can I make the second source extend the first one and not overwrite it? I tried to add extend to the source file, but this did not work.

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh --extend"
edit retag flag offensive close merge delete