Rev 5139: (robertc) Make sure ExecutablePath and InterpreterPath are set in in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 8 07:17:42 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5139 [merge]
revision-id: pqm at pqm.ubuntu.com-20100408061741-m7vl6z97vu33riv7
parent: pqm at pqm.ubuntu.com-20100407234039-52svwnj557wnywlm
parent: robertc at robertcollins.net-20100408043403-56z0d07vdqrx7f3t
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-04-08 07:17:41 +0100
message:
  (robertc) Make sure ExecutablePath and InterpreterPath are set in
  	Apport. (Martin Pool, James Westby, lp:528114)
renamed:
  contrib/apport/ => apport/ contribapport-20100131162357-aladkx1ilh730byb-1
  contrib/apport/bzr.conf => apport/bzr-crashdb.conf bzr.conf-20100131163221-0u77xzj0p9auj54u-2
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  apport/source_bzr.py           source_bzr.py-20100131163221-0u77xzj0p9auj54u-3
  bzrlib/crash.py                crash.py-20090812083334-d6volool4lktdjcx-1
  bzrlib/tests/test_crash.py     test_crash.py-20090820042958-jglgza3wrn03ha9e-2
  setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
=== modified file 'NEWS'
--- a/NEWS	2010-04-07 00:50:56 +0000
+++ b/NEWS	2010-04-08 04:34:03 +0000
@@ -22,6 +22,11 @@
 Bug Fixes
 *********
 
+* Make sure the ``ExecutablePath`` and ``InterpreterPath`` are set in
+  Apport crash reports, to avoid "This problem report applies to a program
+  which is not installed any more" error.
+  (Martin Pool, James Westby, #528114)
+
 * When invoked with a range revision, ``bzr log`` doesn't show revisions
   that are not part of the ancestry anymore.
   (Vincent Ladeuil, #474807)

=== renamed directory 'contrib/apport' => 'apport'
=== renamed file 'contrib/apport/bzr.conf' => 'apport/bzr-crashdb.conf'
=== modified file 'apport/source_bzr.py'
--- a/contrib/apport/source_bzr.py	2010-01-31 19:37:11 +0000
+++ b/apport/source_bzr.py	2010-04-08 04:34:03 +0000
@@ -32,8 +32,7 @@
 
 
 def add_info(report):
-
-    _add_log_tail()
+    _add_log_tail(report)
     if 'BzrPlugins' not in report:
         # may already be present in-process
         report['BzrPlugins'] = command_output(['bzr', 'plugins', '-v'])

=== modified file 'bzrlib/crash.py'
--- a/bzrlib/crash.py	2010-04-05 15:35:14 +0000
+++ b/bzrlib/crash.py	2010-04-08 04:34:03 +0000
@@ -143,8 +143,9 @@
     exc_type, exc_object, exc_tb = exc_info
 
     pr = Report()
-    # add_proc_info gets the executable and interpreter path, which is needed,
-    # plus some less useful stuff like the memory map
+    # add_proc_info gives you the memory map of the process, which is not so
+    # useful for Bazaar but does tell you what binary libraries are loaded.
+    # More importantly it sets the ExecutablePath, InterpreterPath, etc.
     pr.add_proc_info()
     pr.add_user_info()
 
@@ -165,6 +166,19 @@
     pr['PythonLoadedModules'] = _format_module_list()
     pr['BzrDebugFlags'] = pprint.pformat(debug.debug_flags)
 
+    # actually we'd rather file directly against the upstream product, but
+    # apport does seem to count on there being one in there; we might need to
+    # redirect it elsewhere anyhow
+    pr['SourcePackage'] = 'bzr'
+    pr['Package'] = 'bzr'
+
+    # tell apport to file directly against the bzr package using 
+    # <https://bugs.edge.launchpad.net/bzr/+bug/391015>
+    #
+    # XXX: unfortunately apport may crash later if the crashdb definition
+    # file isn't present
+    pr['CrashDb'] = 'bzr'
+
     tb_file = StringIO()
     traceback.print_exception(exc_type, exc_object, exc_tb, file=tb_file)
     pr['Traceback'] = tb_file.getvalue()

=== modified file 'bzrlib/tests/test_crash.py'
--- a/bzrlib/tests/test_crash.py	2010-02-23 07:43:11 +0000
+++ b/bzrlib/tests/test_crash.py	2010-04-08 04:34:03 +0000
@@ -67,6 +67,8 @@
             '(?m)^BzrVersion:') # should be in the traceback
         self.assertContainsRe(report, 'my error')
         self.assertContainsRe(report, 'AssertionError')
+        # see https://bugs.launchpad.net/bzr/+bug/528114
+        self.assertContainsRe(report, 'ExecutablePath')
         self.assertContainsRe(report, 'test_apport_report')
         # should also be in there
         self.assertContainsRe(report, '(?m)^CommandLine:')

=== modified file 'setup.py'
--- a/setup.py	2010-03-26 07:58:58 +0000
+++ b/setup.py	2010-04-08 04:34:03 +0000
@@ -712,6 +712,19 @@
         # easy_install one
         DATA_FILES = [('man/man1', ['bzr.1'])]
 
+    if sys.platform != 'win32':
+        # see https://wiki.kubuntu.org/Apport/DeveloperHowTo
+        #
+        # checking the paths and hardcoding the check for root is a bit gross,
+        # but I don't see a cleaner way to find out the locations in a way
+        # that's going to align with the hardcoded paths in apport.
+        if os.geteuid() == 0:
+            DATA_FILES += [
+                ('/usr/share/apport/package-hooks',
+                    ['apport/source_bzr.py']),
+                ('/etc/apport/crashdb.conf.d/',
+                    ['apport/bzr-crashdb.conf']),]
+
     # std setup
     ARGS = {'scripts': ['bzr'],
             'data_files': DATA_FILES,




More information about the bazaar-commits mailing list