Commit e90e098
authored
Treat unrecognized ROS_DISTRO as a future distro (#1485)
Previously, `getDistroId()` returned `UNKNOWN (0)` for any `ROS_DISTRO` value not in the known map. This caused forward-looking feature guards (e.g., `>= ROLLING`) to fail for future distros like "lyrical", even though they would include the same ABI changes as Rolling.
Now, if `ROS_DISTRO` is set but not recognized, `getDistroId()` returns `FUTURE (9999)` instead, so feature guards pass correctly. If `ROS_DISTRO` is unset, it still returns `UNKNOWN (0)`.
### Changes
- **lib/distro.js**
- Added `FUTURE: 9999` to `DistroId` enum
- Updated `getDistroId()` to return `FUTURE` when `ROS_DISTRO` is set but not in the known map, `UNKNOWN` when unset
- **test/test-distro.js**
- Updated "unknown distro" test to expect `FUTURE` for unrecognized `ROS_DISTRO` values
- Added assertion for truly unset `ROS_DISTRO` returning `UNKNOWN`
Fix: #14841 parent 1af7e77 commit e90e098
3 files changed
Lines changed: 21 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
72 | 73 | | |
73 | | - | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| |||
0 commit comments