Skip to content

Commit a93f04e

Browse files
authored
Skip package if XML is not present in rosdistro
Handle case where package XML is not found and skip processing, workaround for RoboStack/ros-jazzy#107 (comment)
1 parent 8ba3ab6 commit a93f04e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

vinca/main.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,17 @@ def generate_output(pkg_shortname, vinca_conf, distro, version, all_pkgs=None):
334334
},
335335
"build": {"script": ""},
336336
}
337+
338+
xml = distro.get_release_package_xml(pkg_shortname)
339+
340+
# If the snapshot is not aligned with the latest rosdistro (for example if a package is removed,
341+
# see https://github.com/RoboStack/ros-jazzy/pull/107#issuecomment-3338962041), get_release_package_xml can return none,
342+
# in that case we can just skip the package, remove if https://github.com/RoboStack/vinca/issues/93 is fixed
343+
if not xml:
344+
print("Skip " + pkg_shortname + " as it is present in our snapshot, but not in the latest rosdistro cache.")
345+
return None
337346

338-
pkg = catkin_pkg.package.parse_package_string(
339-
distro.get_release_package_xml(pkg_shortname)
340-
)
347+
pkg = catkin_pkg.package.parse_package_string(xml)
341348

342349
pkg.evaluate_conditions(os.environ)
343350

0 commit comments

Comments
 (0)