File: 0001-Add-debian-rosdistro.patch

package info (click to toggle)
ros-rosdistro 0.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 656 kB
  • sloc: python: 4,039; makefile: 38; xml: 22
file content (40 lines) | stat: -rw-r--r-- 1,477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Thu, 17 Feb 2022 16:13:22 +0100
Subject: Add debian rosdistro

---
 src/rosdistro/__init__.py | 7 +++++++
 test/test_index.py        | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/rosdistro/__init__.py b/src/rosdistro/__init__.py
index 64b9f85..5e028f8 100644
--- a/src/rosdistro/__init__.py
+++ b/src/rosdistro/__init__.py
@@ -103,6 +103,13 @@ def get_index(url):
     logger.debug('Load index from "%s"' % url)
     yaml_str = load_url(url)
     data = yaml.safe_load(yaml_str)
+    if data["version"] > 3:
+        data["distributions"]["debian"] = {
+            "distribution": ["file:///usr/share/python3-rosdistro/debian.yaml"],
+            "distribution_status": "rolling",
+            "distribution_type": "ros1",
+            "python_version": 3,
+        }
     base_url = os.path.dirname(url)
     url_parts = urlparse(url)
     return Index(data, base_url, url_query=url_parts.query)
diff --git a/test/test_index.py b/test/test_index.py
index 1208f8a..c076ed7 100644
--- a/test/test_index.py
+++ b/test/test_index.py
@@ -52,7 +52,7 @@ def test_get_index_v3_invalid():
 def test_get_index_v4():
     url = 'file://' + FILES_DIR + '/index_v4.yaml'
     i = get_index(url)
-    assert len(i.distributions.keys()) == 1
+    assert len(i.distributions.keys()) == 2
     assert 'foo' in i.distributions.keys()
 
     assert i.distributions['foo']['distribution_status'] == 'active'