Merge ~emitorino/review-tools:fix_arch_qualifier_issue_for_rocks_manifest_parsing into review-tools:master

Proposed by Emilia Torino
Status: Merged
Merged at revision: c42ae7c55612c11b9702b7a2335590381c37b319
Proposed branch: ~emitorino/review-tools:fix_arch_qualifier_issue_for_rocks_manifest_parsing
Merge into: review-tools:master
Diff against target: 51 lines (+9/-2)
3 files modified
reviewtools/store.py (+7/-1)
reviewtools/tests/test_store.py (+1/-0)
tests/test-rocks-store-unittest-1.db (+1/-1)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+408743@code.launchpad.net

Commit message

- store.py: properly parse arch qualifier if present on rock dpkg.query

Description of the change

To post a comment you must log in.
Revision history for this message
Paulo Flabiano Smorigo (pfsmorigo) wrote :

LGTM

Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reviewtools/store.py b/reviewtools/store.py
2index 3e27b4e..e6fb87b 100644
3--- a/reviewtools/store.py
4+++ b/reviewtools/store.py
5@@ -471,6 +471,13 @@ def get_packages_from_rock_manifest_section(d, manifest_section, package_type):
6 binary_pkg = pkg_info[0].split("=")
7 if len(binary_pkg) == 2:
8 binary_pkg_name = binary_pkg[0]
9+ # Since dpkg 1.16.2, the binary name could include and arch qualifier: e.g liblz4-1:amd64
10+ # For now we assume that if the colon is present, we are in a situation where the binary name is
11+ # including the arch. We could assert valid architectures as well but that means this code should be
12+ # updated as new arch are supported or even existing ones are removed.
13+ arch_qualifier_parts = binary_pkg_name.split(":")
14+ if len(arch_qualifier_parts) == 2:
15+ binary_pkg_name = arch_qualifier_parts[0]
16 ver = binary_pkg[1]
17 if binary_pkg_name in update_binaries_ignore:
18 debug("Skipping ignored binary: '%s'" % binary_pkg_name)
19@@ -544,7 +551,6 @@ def get_secnots_for_manifest(
20 raise ValueError("'%s' not found in security notification database" % rel)
21
22 pending_secnots = {}
23-
24 if stage_and_build_pkgs is None:
25 debug("no stage-packages found")
26 return pending_secnots
27diff --git a/reviewtools/tests/test_store.py b/reviewtools/tests/test_store.py
28index 79a0156..a86d1b2 100644
29--- a/reviewtools/tests/test_store.py
30+++ b/reviewtools/tests/test_store.py
31@@ -767,6 +767,7 @@ class TestStore(TestCase):
32 "apt": "2.0.2ubuntu0.2",
33 "bsdutils": "1:2.34-0.1ubuntu9.1",
34 "libxcursor1": "1.0.0-2ubuntu1",
35+ "libcurl4": "7.74.0-1ubuntu2.1",
36 }
37 for pkg_name in expected_stage_packages:
38 self.assertIn(pkg_name, res["staged"])
39diff --git a/tests/test-rocks-store-unittest-1.db b/tests/test-rocks-store-unittest-1.db
40index f6934da..d256a61 100644
41--- a/tests/test-rocks-store-unittest-1.db
42+++ b/tests/test-rocks-store-unittest-1.db
43@@ -11,7 +11,7 @@
44 "edge",
45 "beta"
46 ],
47- "manifest_yaml": "manifest-version: '1'\nname: redis\nos-release-id: ubuntu\nos-release-version-id: '20.04'\narchitectures: \n- amd64\nstage-packages: \n - adduser=3.118ubuntu2,adduser=3.118ubuntu2\n - apt=2.0.2ubuntu0.2,apt=2.0.2ubuntu0.2\n - bsdutils=1:2.34-0.1ubuntu9.1,util-linux=2.34-0.1ubuntu9.1\n - libxcursor1=1.0.0-2ubuntu1,tiff=1.0.0-2ubuntu1\n",
48+ "manifest_yaml": "manifest-version: '1'\nname: redis\nos-release-id: ubuntu\nos-release-version-id: '20.04'\narchitectures: \n- amd64\nstage-packages: \n - adduser=3.118ubuntu2,adduser=3.118ubuntu2\n - apt=2.0.2ubuntu0.2,apt=2.0.2ubuntu0.2\n - bsdutils=1:2.34-0.1ubuntu9.1,util-linux=2.34-0.1ubuntu9.1\n - libxcursor1=1.0.0-2ubuntu1,tiff=1.0.0-2ubuntu1\n - libcurl4:amd64=7.74.0-1ubuntu2.1,curl=7.74.0-1ubuntu2.1\n",
49 "version": "5.0-20.04",
50 "revision": "852f7702e973",
51 "architectures": [

Subscribers

People subscribed via source and target branches