Commit dcc3fd40 authored by Felix Exner's avatar Felix Exner
Browse files

Look into the package.xml files to find subfolders

In fact, the subfolder does not have to contain the package name at all.
Assuming this created a couple of false positives (e.g. rosbag_storage -> test/test_rosbag_storage)

If we look into the package.xml files the name has to exactly match the package name.
parent 1cab9815
......@@ -4,7 +4,7 @@ import sys
import re
import subprocess
import urllib
import xml.etree.ElementTree as ET
class Update(Routines):
......@@ -100,8 +100,11 @@ class Update(Routines):
repo = self.gh.get_repo(repo_name)
contents = repo.get_contents(".")
for content in contents:
if self.package_info['orig_name'] in content.path and content.type == 'dir':
return content.path
if content.name == 'package.xml':
root = ET.fromstring(content.decoded_content)
name = root.find('name')
if name.text == self.package_info['orig_name']:
return os.path.dirname(content.path)
if content.type == 'dir':
contents.extend(repo.get_contents(content.path))
raise RuntimeError("Can't find nested path: " + self.package)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment