ros-tooling / cross_compile

A tool to build ROS and ROS2 workspaces for various targets
Apache License 2.0
188 stars 60 forks source link

Combine rosdep multiple apt commands into a single apt command #165

Closed emersonknapp closed 4 years ago

emersonknapp commented 4 years ago

Description

On a sizeable ros project, there may be a few dozen rosdeps to install. The script that rosdep output has one apt-get install -y command per dependency. Every apt install command takes time to read the package list, especially in an emulated environment this takes several seconds. When the given installation command was a no-op, which often happens as many ros packages share dependencies, this time is completely wasted.

A manipulation of the output script to combine into a single apt-get install -y pkg pkg pkg command will speed up this step significantly.

Related Issues

N/A

Completion Criteria

Implementation Notes / Suggestions

something like

cat install_rosdeps.sh |
# match `apt-get install` lines
sed some_pattern |
# get just the package names 
awk '{print $4}' |
# maybe sort?
sort |
# combine onto one line
awk '{print}' ORS='" '

Testing Notes / Suggestions

Check file contents to expected.