Back to index

apport  2.3
source_apport.py
Go to the documentation of this file.
00001 '''Apport package hook for apport itself.
00002 
00003 This adds /var/log/apport.log and the file listing in /var/crash to the report.
00004 '''
00005 
00006 # Copyright 2007 Canonical Ltd.
00007 # Author: Martin Pitt <martin.pitt@ubuntu.com>
00008 
00009 APPORT_LOG = '/var/log/apport.log'
00010 
00011 from glob import glob
00012 import apport.hookutils
00013 
00014 
00015 def add_info(report):
00016     apport.hookutils.attach_file_if_exists(report, APPORT_LOG, 'ApportLog')
00017     reports = glob('/var/crash/*')
00018     if reports:
00019         report['CrashReports'] = apport.hookutils.command_output(
00020             ['stat', '-c', '%a:%u:%g:%s:%y:%x:%n'] + reports)