50
50
report['Title'] = title
52
52
# check package origin
53
if 'Package' not in report or \
54
not apport.packaging.is_distro_package(report['Package'].split()[0]):
53
if ('Package' not in report or \
54
not apport.packaging.is_distro_package(report['Package'].split()[0])) \
55
and 'CrashDB' not in report:
55
56
if 'APPORT_REPORT_THIRDPARTY' in os.environ or \
56
57
apport.fileutils.get_config('main', 'thirdparty', False, bool=True):
57
58
report['ThirdParty'] = 'True'
264
265
If a pid is given on the command line, the report will contain runtime
265
debug information. Either a package or a pid must be specified.'''
266
debug information. Either a package or a pid must be specified.
267
268
if not self.options.package and not self.options.pid:
268
269
self.ui_error_message(_('No package specified'),
269
270
_('You need to specify a package or a PID. See --help for more information.'))
271
272
self.report = apport.Report('Bug')
274
# if PID is given, add info
274
277
self.report.add_proc_info(self.options.pid)
276
self.report.add_proc_environ()
278
self.ui_error_message(_('Invalid PID'),
279
_('The specified process ID does not belong to a program.'))
282
# silently ignore nonexisting PIDs; the user must not close the
283
# application prematurely
284
if e.errno == errno.ENOENT:
286
elif e.errno == errno.EACCES:
287
self.ui_error_message(_('Permission denied'),
288
_('The specified process does not belong to you. Please run this program as the process owner or as root.'))
279
self.ui_error_message(_('Invalid PID'),
280
_('The specified process ID does not belong to a program.'))
283
# silently ignore nonexisting PIDs; the user must not close the
284
# application prematurely
285
if e.errno == errno.ENOENT:
287
elif e.errno == errno.EACCES:
288
self.ui_error_message(_('Permission denied'),
289
_('The specified process does not belong to you. Please run this program as the process owner or as root.'))
294
self.report.add_proc_environ()
292
296
if self.options.package:
293
297
self.options.package = self.options.package.strip()
294
298
# "Do what I mean" for filing against "linux"