Merge ~brian-murray/ubuntu-archive-tools:sru-review-updates into ubuntu-archive-tools:main

Proposed by Brian Murray
Status: Merged
Merged at revision: ca42e57d487ac75fd671f9d5150aa825b25101a0
Proposed branch: ~brian-murray/ubuntu-archive-tools:sru-review-updates
Merge into: ubuntu-archive-tools:main
Diff against target: 47 lines (+15/-8)
1 file modified
sru-review (+15/-8)
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+417832@code.launchpad.net

Description of the change

sru-review is supposed to check if a there is an existing SRU of a package in -proposed and while it did that what it did not do was properly check to see if that package was copied to -updates. This fixes that by checking for the same version of the package in the -updates pocket as is in the -proposed pocket. (The old way never would have worked as the source package publishing history records are different.)

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, code-wise it looks good. The only thing I would be worried about if not all the variable references were updated after the variable renaming. Otherwise, please go ahead!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/sru-review b/sru-review
2index 600a74a..d644eef 100755
3--- a/sru-review
4+++ b/sru-review
5@@ -364,19 +364,26 @@ if __name__ == '__main__':
6 (upload, changes_url, debdiff) = from_queue(
7 opts, archive, sourcepkg, series, version)
8
9- # Check for existing version in proposed
10+ # Check to see if there is an existing SRU of the package in -proposed
11+ # and also check that it has not been copied to -updates yet.
12 if series != ubuntu.current_series:
13+ # need the spph so we have access to the package name, version and
14+ # changes_url
15 existing = [
16- pkg for pkg in archive.getPublishedSources(
17+ spph for spph in archive.getPublishedSources(
18 exact_match=True, distro_series=series, pocket='Proposed',
19 source_name=sourcepkg, status='Published')]
20- updates = [
21- pkg for pkg in archive.getPublishedSources(
22+ # only the package name and version are needed for the check
23+ updates_details = [
24+ (spph.source_package_name, spph.source_package_version)
25+ for spph in archive.getPublishedSources(
26 exact_match=True, distro_series=series, pocket='Updates',
27 source_name=sourcepkg, status='Published')]
28- for pkg in existing:
29- if pkg not in updates:
30- changesfile_url = pkg.changesFileUrl()
31+ for spph in existing:
32+ pkg_name = spph.source_package_name
33+ pkg_vers = spph.source_package_version
34+ if (pkg_name, pkg_vers) not in updates_details:
35+ changesfile_url = spph.changesFileUrl()
36 changes = parse_changes(changesfile_url)
37 msg = ('''\
38 *******************************************************
39@@ -385,7 +392,7 @@ if __name__ == '__main__':
40 * SRU Bug: LP: #%s
41 *
42 *******************************************************''' %
43- (sourcepkg, pkg.source_package_version,
44+ (sourcepkg, pkg_vers,
45 ' LP: #'.join(changes['bugs'])))
46 print(msg, file=sys.stderr)
47 print('''View the debdiff anyway? [yN]''', end="")

Subscribers

People subscribed via source and target branches