Skip to content

Commit

Permalink
yocto_recipe: add static method to get ROS_PYTHON_VERSION value
Browse files Browse the repository at this point in the history
* it will be used for creating context for conditional evaluations in rosdistro as well

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
  • Loading branch information
shr-project committed Nov 11, 2020
1 parent e0b59c0 commit 07ba6f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions superflore/generators/bitbake/yocto_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ def _get_ros_version(distro):
return 2 if distro not in distros \
else int(distros[distro]['distribution_type'][len('ros'):])

@staticmethod
def _get_ros_python_version(distro):
return '2' if distro not in ['melodic'] else '3'

@staticmethod
def generate_superflore_datetime_inc(basepath, dist, now):
datetime_dir = '{0}/meta-ros{1}-{2}/conf/ros-distro/include/{2}/' \
Expand Down Expand Up @@ -561,11 +565,9 @@ def generate_ros_distro_inc(
'\nROS_DISTRO_TYPE = "ros{}"\n'.format(ros_version))
conf_file.write('ROS_VERSION = "{}"\n'.format(ros_version))
conf_file.write('# DO NOT OVERRIDE ROS_PYTHON_VERSION\n')
ros_python_version = 3
if distro == 'melodic':
ros_python_version = 2
conf_file.write(
'ROS_PYTHON_VERSION = "{}"\n\n'.format(ros_python_version))
'ROS_PYTHON_VERSION = "{}"\n\n'.format(
yoctoRecipe._get_ros_python_version(distro)))
oe_skip_keys = map(
lambda skip_key: yoctoRecipe.convert_to_oe_name(skip_key),
skip_keys
Expand Down

0 comments on commit 07ba6f0

Please sign in to comment.