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
=== modified file 'apport/crashdb_impl/launchpad.py'
--- apport/crashdb_impl/launchpad.py 2009-09-04 18:48:00 +0000
+++ apport/crashdb_impl/launchpad.py 2009-09-12 12:02:56 +0000
@@ -171,7 +171,11 @@
171 hdr['Subscribers'] = 'apport'171 hdr['Subscribers'] = 'apport'
172 if report.has_key('Tags'):172 if report.has_key('Tags'):
173 hdr['Tags'] += ' ' + report['Tags']173 hdr['Tags'] += ' ' + report['Tags']
174174
175 # Add Distro ID and Codename as Tags to better LP filtering
176 # FIXME: ugly Ubuntu specific hack until LP has a real crash db
177 hdr['Tags'] += ' ' + report['DistroRelease'].split()[0].lower + ' ' + report['DistroRelease'].split()[2]
178
175 # write MIME/Multipart version into temporary file179 # write MIME/Multipart version into temporary file
176 mime = tempfile.TemporaryFile()180 mime = tempfile.TemporaryFile()
177 report.write_mime(mime, extra_headers=hdr)181 report.write_mime(mime, extra_headers=hdr)
178182
=== modified file 'apport/report.py'
--- apport/report.py 2009-09-10 03:10:16 +0000
+++ apport/report.py 2009-09-12 12:02:56 +0000
@@ -217,13 +217,13 @@
217 '''Add operating system information.217 '''Add operating system information.
218218
219 This adds:219 This adds:
220 - DistroRelease: lsb_release -sir output220 - DistroRelease: lsb_release -sirc output
221 - Architecture: system architecture in distro specific notation221 - Architecture: system architecture in distro specific notation
222 - Uname: uname -srm output222 - Uname: uname -srm output
223 - NonfreeKernelModules: loaded kernel modules which are not free (if223 - NonfreeKernelModules: loaded kernel modules which are not free (if
224 there are none, this field will not be present)224 there are none, this field will not be present)
225 '''225 '''
226 p = subprocess.Popen(['lsb_release', '-sir'], stdout=subprocess.PIPE,226 p = subprocess.Popen(['lsb_release', '-sirc'], stdout=subprocess.PIPE,
227 stderr=subprocess.PIPE, close_fds=True)227 stderr=subprocess.PIPE, close_fds=True)
228 self['DistroRelease'] = p.communicate()[0].strip().replace('\n', ' ')228 self['DistroRelease'] = p.communicate()[0].strip().replace('\n', ' ')
229229
230230
=== modified file 'backends/packaging-apt-dpkg.py'
--- backends/packaging-apt-dpkg.py 2009-09-08 12:16:54 +0000
+++ backends/packaging-apt-dpkg.py 2009-09-12 22:55:19 +0000
@@ -189,9 +189,9 @@
189189
190 for line in open(sumfile):190 for line in open(sumfile):
191 try:191 try:
192 # ignore lines with NUL bytes (happens, LP#96050)192 # ignore lines with NULL bytes (happens, LP#96050)
193 if '\0' in line:193 if '\0' in line:
194 print >> sys.stderr, 'WARNING:', sumfile, 'contains NUL character, ignoring line'194 print >> sys.stderr, 'WARNING:', sumfile, 'contains NULL character, ignoring line'
195 continue195 continue
196 words = line.split()196 words = line.split()
197 if not words:197 if not words:
@@ -458,7 +458,7 @@
458 candidate_version = c[pkg].candidateVersion458 candidate_version = c[pkg].candidateVersion
459 else:459 else:
460 candidate_version = c[pkg].candidate.version460 candidate_version = c[pkg].candidate.version
461 if ver and candidate_version != ver:461 if ver and candidate_version != ver and ver is not 'None':
462 if not pkg.endswith('-dbgsym'):462 if not pkg.endswith('-dbgsym'):
463 outdated += '%s: installed version %s, latest version: %s\n' % (463 outdated += '%s: installed version %s, latest version: %s\n' % (
464 pkg, ver, candidate_version)464 pkg, ver, candidate_version)

Subscribers

People subscribed via source and target branches