Merge lp:~ursinha/ubuntu-archive-tools/proposed-component-mismatches into lp:ubuntu-archive-tools

Proposed by Ursula Junque
Status: Merged
Merged at revision: 690
Proposed branch: lp:~ursinha/ubuntu-archive-tools/proposed-component-mismatches
Merge into: lp:ubuntu-archive-tools
Diff against target: 137 lines (+60/-37)
1 file modified
component-mismatches (+60/-37)
To merge this branch: bzr merge lp:~ursinha/ubuntu-archive-tools/proposed-component-mismatches
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+154537@code.launchpad.net

Description of the change

These changes make component-mismatches consider all pertinent pockets depending on the pocket we want to run it against. This is required to check -proposed correctly, considering release+updates+security+proposed packages.

For component-mismatches to work accordingly in this case, we need to run germinate against release plus the pockets we want, and use these germinated files to feed it.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks, this looks good. Sorry for my delay in reviewing this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'component-mismatches'
2--- component-mismatches 2012-12-13 14:50:11 +0000
3+++ component-mismatches 2013-03-20 22:27:23 +0000
4@@ -71,19 +71,24 @@
5
6
7 def read_current_source(options):
8- for component in options.all_components:
9- sources_path = "%s/dists/%s/%s/source/Sources.gz" % (
10- options.archive_dir, options.suite, component)
11- for section in apt_pkg.TagFile(decompress_open(sources_path)):
12- if 'Package' in section and 'Version' in section:
13- (pkg, version) = (section['Package'], section['Version'])
14- if pkg not in archive_source:
15- archive_source[pkg] = (version, component)
16- else:
17- if apt_pkg.VersionCompare(
18- archive_source[pkg][0], version) < 0:
19- archive_source[pkg] = (
20- version, component.split("/")[0])
21+ for pocket in options.pockets:
22+ if pocket != options.suite:
23+ suite = "%s-%s" % (options.suite, pocket)
24+ else:
25+ suite = options.suite
26+ for component in options.all_components:
27+ sources_path = "%s/dists/%s/%s/source/Sources.gz" % (
28+ options.archive_dir, suite, component)
29+ for section in apt_pkg.TagFile(decompress_open(sources_path)):
30+ if 'Package' in section and 'Version' in section:
31+ (pkg, version) = (section['Package'], section['Version'])
32+ if pkg not in archive_source:
33+ archive_source[pkg] = (version, component)
34+ else:
35+ if apt_pkg.VersionCompare(
36+ archive_source[pkg][0], version) < 0:
37+ archive_source[pkg] = (
38+ version, component.split("/")[0])
39
40 for pkg, (version, component) in archive_source.items():
41 if component in options.components:
42@@ -95,24 +100,29 @@
43 for component in options.all_components:
44 components_with_di.append(component)
45 components_with_di.append('%s/debian-installer' % component)
46- for component in components_with_di:
47- for arch in ["i386", "amd64", "powerpc", "armhf"]:
48- binaries_path = "%s/dists/%s/%s/binary-%s/Packages.gz" % (
49- options.archive_dir, options.suite, component, arch)
50- for section in apt_pkg.TagFile(decompress_open(binaries_path)):
51- if 'Package' in section and 'Version' in section:
52- (pkg, version) = (section['Package'], section['Version'])
53- if 'source' in section:
54- src = section['Source']
55- else:
56- src = section['Package']
57- if pkg not in archive_binary:
58- archive_binary[pkg] = (
59- version, component.split("/")[0], src)
60- else:
61- if apt_pkg.VersionCompare(
62- archive_binary[pkg][0], version) < 0:
63- archive_binary[pkg] = (version, component, src)
64+ for pocket in options.pockets:
65+ if options.suite != pocket:
66+ suite = "%s-%s" % (options.suite, pocket)
67+ else:
68+ suite = options.suite
69+ for component in components_with_di:
70+ for arch in ["i386", "amd64", "powerpc", "armhf"]:
71+ binaries_path = "%s/dists/%s/%s/binary-%s/Packages.gz" % (
72+ options.archive_dir, suite, component, arch)
73+ for section in apt_pkg.TagFile(decompress_open(binaries_path)):
74+ if 'Package' in section and 'Version' in section:
75+ (pkg, version) = (section['Package'], section['Version'])
76+ if 'source' in section:
77+ src = section['Source']
78+ else:
79+ src = section['Package']
80+ if pkg not in archive_binary:
81+ archive_binary[pkg] = (
82+ version, component.split("/")[0], src)
83+ else:
84+ if apt_pkg.VersionCompare(
85+ archive_binary[pkg][0], version) < 0:
86+ archive_binary[pkg] = (version, component, src)
87
88 for pkg, (version, component, src) in archive_binary.items():
89 if component in options.components:
90@@ -495,9 +505,8 @@
91 def do_source_diff(options):
92 removed = []
93 added = []
94- for pkg in current_source:
95- if pkg not in germinate_source:
96- removed.append(pkg)
97+ removed = list(set(current_source.keys()).difference(
98+ set(germinate_source.keys())))
99 for pkg in germinate_source:
100 if (pkg not in current_source and
101 is_included_source(options, pkg) and
102@@ -511,9 +520,8 @@
103 def do_binary_diff(options):
104 removed = []
105 added = {}
106- for pkg in current_binary:
107- if pkg not in germinate_binary:
108- removed.append(pkg)
109+ removed = list(set(current_binary.keys()).difference(
110+ set(germinate_binary.keys())))
111 for pkg in germinate_binary:
112 if (pkg not in current_binary and
113 is_included_binary(options, pkg) and
114@@ -565,9 +573,24 @@
115 options.components = options.component.split(',')
116 options.all_components = ["main", "restricted", "universe", "multiverse"]
117
118+ options.pockets = []
119 if options.suite is None:
120 options.suite = options.distro.current_series.name
121
122+ # Considering all the packages to have a full installable suite. So:
123+ # -updates = release + -updates
124+ # -security = release + -updates + -security
125+ # -proposed = release + updates + security + proposed
126+ if "-" in options.suite:
127+ options.suite, options.pocket = options.suite.split("-")
128+ if options.pocket in ["updates", "security", "proposed"]:
129+ options.pockets.append("updates")
130+ if options.pocket in ["security", "proposed"]:
131+ options.pockets.append("security")
132+ if options.pocket in ["proposed"]:
133+ options.pockets.append("proposed")
134+ options.pockets.append(options.suite)
135+
136 if options.output_file is not None:
137 sys.stdout = open('%s.new' % options.output_file, 'w')
138

Subscribers

People subscribed via source and target branches