Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes rospack export for package with condition attrib #125

Open
wants to merge 2 commits into
base: noetic-devel
Choose a base branch
from

Conversation

k-okada
Copy link
Contributor

@k-okada k-okada commented Mar 9, 2021

For example

$ rospack export --lang=cpp --attrib=cflags eigenpy

returns error with

[rospack] Error: package 'eigenpy' depends on non-existent package 'ament_cmake' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update

If we have #113, it will outputs the result, but on melodic, we can not run export if for example eigenpy and other packages wihch skip rosdep rule by condition attribute, failing

This pr check condition attribute and evaluate them

@jacobperron jacobperron changed the title fixes rospck export for packaeg with condition attrib fixes rospck export for package with condition attrib Mar 11, 2021
@jacobperron jacobperron changed the title fixes rospck export for package with condition attrib fixes rospack export for package with condition attrib Mar 11, 2021
Comment on lines +1637 to +1641
std::istringstream condition_stream(condition);
std::string l, op, r;
condition_stream >> l;
condition_stream >> op;
condition_stream >> r;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I think it's a bit more complicated than assuming we have exactly the pattern "lhs op rhs". According to spec, spaces are optional and parentheses are allowed too. So, I don't think the following input will work out as you might expect: "$ROS_VERSION==1"

Also consider a more complex example (I think is valid):

"($ROS_VERSION == 1 and $FOO != bar) or $FOO == baz"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants