Merge lp:~gothicx/apport/retrace_installed_none into lp:~apport-hackers/apport/trunk

Proposed by Marco Rodrigues
Status: Rejected
Rejected by: Martin Pitt
Proposed branch: lp:~gothicx/apport/retrace_installed_none
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~gothicx/apport/retrace_installed_none
Reviewer Review Type Date Requested Status
Martin Pitt (community) Disapprove
Review via email: mp+11655@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

http://bazaar.launchpad.net/~gothicx/apport/retrace_installed_none/revision/1595:

> hdr['Tags'] += ' ' + report['DistroRelease'].split()[0].lower + ' ' + report['DistroRelease'].split()[2]

This has some problems:

 * It will immediately crash because "lower" is a function, not a function call. This obviously hasn't been tested.
 * We should not assume that lsb_release delivers a code name on all distributions out there, so it should be tested more carefully first.
 * There is no need to add a tag for the first field. The bugs will already be filed against the "Ubuntu" distribution in Launchpad, tagging them all with "ubuntu" is just redundant.

http://bazaar.launchpad.net/~gothicx/apport/retrace_installed_none/revision/1596:

Can you please reproduce this locally with python-apt first, and perhaps put this as a reproducer into the test suite? I suppose this happens with virtual packages or something similar. Simply papering over the faulty case merely hides the underlying problem.

review: Needs Fixing
Revision history for this message
Marco Rodrigues (gothicx) wrote :

I remember why I've added the distro name from lsb_release to the tags. Apport currently report everything as 'ubuntu' in LP. Brian suggested to be tagged with the distro name, because we can have tags like 'ubuntu', 'kubuntu', 'xubuntu', 'gobuntu', etc.

What do you think about that ?

Revision history for this message
Martin Pitt (pitti) wrote :

Marco Rodrigues [2009-09-14 21:04 -0000]:
> I remember why I've added the distro name from lsb_release to the
> tags. Apport currently report everything as 'ubuntu' in LP. Brian
> suggested to be tagged with the distro name, because we can have
> tags like 'ubuntu', 'kubuntu', 'xubuntu', 'gobuntu', etc.

lsb_release doesn't give you the derivative, though. In fact it's not
that easy to know what kind of derivative you are running, since you
can install packages from any of them, and have a wild mix.

Revision history for this message
Martin Pitt (pitti) wrote :

No response for a long time, this has some serious bugs, and the code changed a lot since then; closing. If you still want to work on this, please open a new merge proposal. Thanks!

review: Disapprove

Unmerged revisions

1596. By Marco Rodrigues

Don't abort retrace if installed package version is None

1595. By Marco Rodrigues

Add default tags for distro id / codename

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apport/crashdb_impl/launchpad.py'
2--- apport/crashdb_impl/launchpad.py 2009-09-04 18:48:00 +0000
3+++ apport/crashdb_impl/launchpad.py 2009-09-12 12:02:56 +0000
4@@ -171,7 +171,11 @@
5 hdr['Subscribers'] = 'apport'
6 if report.has_key('Tags'):
7 hdr['Tags'] += ' ' + report['Tags']
8-
9+
10+ # Add Distro ID and Codename as Tags to better LP filtering
11+ # FIXME: ugly Ubuntu specific hack until LP has a real crash db
12+ hdr['Tags'] += ' ' + report['DistroRelease'].split()[0].lower + ' ' + report['DistroRelease'].split()[2]
13+
14 # write MIME/Multipart version into temporary file
15 mime = tempfile.TemporaryFile()
16 report.write_mime(mime, extra_headers=hdr)
17
18=== modified file 'apport/report.py'
19--- apport/report.py 2009-09-10 03:10:16 +0000
20+++ apport/report.py 2009-09-12 12:02:56 +0000
21@@ -217,13 +217,13 @@
22 '''Add operating system information.
23
24 This adds:
25- - DistroRelease: lsb_release -sir output
26+ - DistroRelease: lsb_release -sirc output
27 - Architecture: system architecture in distro specific notation
28 - Uname: uname -srm output
29 - NonfreeKernelModules: loaded kernel modules which are not free (if
30 there are none, this field will not be present)
31 '''
32- p = subprocess.Popen(['lsb_release', '-sir'], stdout=subprocess.PIPE,
33+ p = subprocess.Popen(['lsb_release', '-sirc'], stdout=subprocess.PIPE,
34 stderr=subprocess.PIPE, close_fds=True)
35 self['DistroRelease'] = p.communicate()[0].strip().replace('\n', ' ')
36
37
38=== modified file 'backends/packaging-apt-dpkg.py'
39--- backends/packaging-apt-dpkg.py 2009-09-08 12:16:54 +0000
40+++ backends/packaging-apt-dpkg.py 2009-09-12 22:55:19 +0000
41@@ -189,9 +189,9 @@
42
43 for line in open(sumfile):
44 try:
45- # ignore lines with NUL bytes (happens, LP#96050)
46+ # ignore lines with NULL bytes (happens, LP#96050)
47 if '\0' in line:
48- print >> sys.stderr, 'WARNING:', sumfile, 'contains NUL character, ignoring line'
49+ print >> sys.stderr, 'WARNING:', sumfile, 'contains NULL character, ignoring line'
50 continue
51 words = line.split()
52 if not words:
53@@ -458,7 +458,7 @@
54 candidate_version = c[pkg].candidateVersion
55 else:
56 candidate_version = c[pkg].candidate.version
57- if ver and candidate_version != ver:
58+ if ver and candidate_version != ver and ver is not 'None':
59 if not pkg.endswith('-dbgsym'):
60 outdated += '%s: installed version %s, latest version: %s\n' % (
61 pkg, ver, candidate_version)

Subscribers

People subscribed via source and target branches