From 23ba569e485ea0cdaf7f6f9251ff708541b28439 Mon Sep 17 00:00:00 2001 From: Artem Smirnov Date: Thu, 6 Sep 2018 21:05:57 +0300 Subject: [PATCH] image_builder: change rosdep installation loop --- image_builder/scripts/ros_install.sh | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/image_builder/scripts/ros_install.sh b/image_builder/scripts/ros_install.sh index 080f93fa..2e35f1cb 100755 --- a/image_builder/scripts/ros_install.sh +++ b/image_builder/scripts/ros_install.sh @@ -80,33 +80,21 @@ fi echo_stamp "#7 Installing dependencies apps with rosdep" cd /home/pi/ros_catkin_ws -# There is a risk that umount will fail set +e # Successfull unmount flag (false at thismoment) install_ok=false # Repeat 5 times -for i in {1..5} -do +for i in {1..5}; do # Resolving Dependencies with rosdep - rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:stretch - # If no problems detected - if [[ $? == 0 ]] - then - echo_stamp "Successfull rosdep install" "SUCCESS" - # Set flag - install_ok=true - # Exit loop - break - fi - # Unmount has failed - echo_stamp "Rosdep installation failed" "ERROR" - # Wait for some time - sleep 2 + rosdep install -y --from-paths src --ignore-src --rosdistro kinetic -r --os=debian:stretch \ + > /dev/null \ + && (install_ok=true; break) || (echo_stamp "rosdep iteration #$i failed!" "ERROR"; sleep 2) done set -e -# Jenkins job will fail if this condition is not true -[[ "$install_ok" == true ]] -echo_stamp "End of rosdep install" +# Stage fail if this condition is not true +[[ $install_ok ]] \ +&& echo_stamp "All rosdep dependencies was installed!" "SUCCESS" \ +|| (echo_stamp "Rosdep installation failed!" "ERROR"; exit 1) echo_stamp "#8 Refactoring usb_cam in SRC" sed -i '/#define __STDC_CONSTANT_MACROS/a\#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24\n#define PIX_FMT_YUV422P AV_PIX_FMT_YUV422P' /home/pi/ros_catkin_ws/src/usb_cam/src/usb_cam.cpp