Merge lp:~brian-murray/apport/bug-1500557 into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 3014
Proposed branch: lp:~brian-murray/apport/bug-1500557
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 38 lines (+15/-3)
1 file modified
backends/packaging-apt-dpkg.py (+15/-3)
To merge this branch: bzr merge lp:~brian-murray/apport/bug-1500557
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+272852@code.launchpad.net

Description of the change

In the event that we can't find a -dbgsym version of a package in the apt cache, which could happen if the Packages file is out of date on the server, we should check Launchpad to see if we can find it there.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

We now have this "get package from apt cache and fall back to LP" four times, this has become quite unwieldy and repetitive. Would you have some time to refactor this?

I merge it for now to unblock the broken retraces. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'backends/packaging-apt-dpkg.py'
2--- backends/packaging-apt-dpkg.py 2015-07-15 18:42:32 +0000
3+++ backends/packaging-apt-dpkg.py 2015-09-29 21:42:16 +0000
4@@ -940,11 +940,11 @@
5 pass
6 real_pkgs.add(p)
7 else:
8+ pkg_found = False
9+ dbgsym_pkg = pkg + '-dbgsym'
10 try:
11- dbgsym_pkg = pkg + '-dbgsym'
12 dbgsym = cache[dbgsym_pkg]
13 real_pkgs.add(dbgsym_pkg)
14- pkg_found = False
15 # prefer the version requested
16 if ver:
17 try:
18@@ -967,7 +967,19 @@
19 obsolete += 'outdated debug symbol package for %s: package version %s dbgsym version %s\n' % (
20 pkg, candidate.version, dbgsym.candidate.version)
21 except KeyError:
22- obsolete += 'no debug symbol package found for %s\n' % pkg
23+ if ver:
24+ (lp_url, sha1sum) = self.get_lp_binary_package(self.get_distro_name(),
25+ dbgsym_pkg, ver, architecture)
26+ if lp_url:
27+ real_pkgs.add(dbgsym_pkg)
28+ acquire_queue.append(apt.apt_pkg.AcquireFile(fetcher,
29+ lp_url,
30+ hash="sha1:%s" % sha1sum,
31+ destdir=archivedir))
32+ lp_cache[dbgsym_pkg] = ver
33+ pkg_found = True
34+ if not pkg_found:
35+ obsolete += 'no debug symbol package found for %s\n' % pkg
36
37 # unpack packages, weed out the ones that are already installed (for
38 # permanent sandboxes)

Subscribers

People subscribed via source and target branches