# Sourcing catkin workspace populates ROS_PACKAGE_PATH with individual package paths

When creating a new catkin workspace, building it and then sourcing devel/setup.sh, the ROS_PACKAGE_PATH is populated with paths from individual packages instead of only the root directory that contains all the packages. The packages are still found when calling roslaunch and all works fine, but my understanding is that ROS_PACKAGE_PATH should only contain the root directory. For example, I create a new catkin workspace:

source /opt/ros/melodic/setup.bash
echo $$ROS_PACKAGE_PATH # prints /opt/ros/melodic/share mkdir -p$$HOME/test_ws/src
cd $$HOME/test_ws/src catkin_init_workspace #copy / create packages pkg1, pkg2, ... cd$$HOME/test_ws
catkin build
source devel/setup.bash
echo $$ROS_PACKAGE_PATH # at this point, i would expect #$$HOME/test_ws/src:/opt/ros/melodic/share, instead i get
#$$HOME/test_ws/src/pkg1:$$HOME/test_ws/src/pkg2:/opt/ros/melodic/share



Is this the normal behavior or am I doing something wrong here?

Seems like this is the expected behavior of catkin build as stated on the Migrating from catkin_make website:
If using the catkin_make, however, it does add only the root/source path of the workspace, as i expected initially.