Merge ~litios/ubuntu-cve-tracker:source_map/broken-built-using into ubuntu-cve-tracker:master

Proposed by David Fernandez Gonzalez
Status: Merged
Merged at revision: 984cc1e101314befbdb4b836b9c340ce671d1df3
Proposed branch: ~litios/ubuntu-cve-tracker:source_map/broken-built-using
Merge into: ubuntu-cve-tracker:master
Diff against target: 21 lines (+7/-2)
1 file modified
scripts/source_map.py (+7/-2)
Reviewer Review Type Date Requested Status
Eduardo Barretto Approve
Review via email: mp+453735@code.launchpad.net

Description of the change

There is an issue when trying to load the built-using information from mantic due to the helvum package, as it carries a modified version of dh-cargo that generated wrong entries for the X-Cargo-Built-Using tag.

This change takes care of the issue by adding an error handler.

To post a comment you must log in.
Revision history for this message
Eduardo Barretto (ebarretto) wrote :

lgtm, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/source_map.py b/scripts/source_map.py
2index 58ef5c3..9f3c66b 100755
3--- a/scripts/source_map.py
4+++ b/scripts/source_map.py
5@@ -321,9 +321,14 @@ def load_built_using_collection(pmap, releases=None, component=None):
6 if pmap[rel][pkg]['pocket'] != '':
7 pocket += "-%s" % pmap[rel][pkg]['pocket']
8
9- for (s, c, v) in map(lambda x: x.split(' ', 3),
10+ for pkg_cmp_ver in map(lambda x: x.split(' ', 3),
11 pmap[rel][pkg][tag]):
12- v = v.rstrip(')')
13+ if len(pkg_cmp_ver) != 3:
14+ print('WARN: Skipping invalid entry (', pkg_cmp_ver, ') for', rel, pkg, 'with tag', tag)
15+ continue
16+
17+ s = pkg_cmp_ver[0]
18+ v = pkg_cmp_ver[2].rstrip(')')
19 if s not in built_using:
20 built_using[s] = dict()
21 if v not in built_using[s]:

Subscribers

People subscribed via source and target branches