apply patch 1 of https://code.ros.org/trac/ros-pkg/ticket/5529
apply patch 2 of https://code.ros.org/trac/ros-pkg/ticket/5529
apply patch 3 of https://code.ros.org/trac/ros-pkg/ticket/5529
remove leftover