Your message dated Mon, 07 Apr 2014 19:04:31 +0200
with message-id <[email protected]>
and subject line Bug #724241 - Apport hook for crashes
has caused the Debian Bug report #724241,
regarding Apport hook for crashes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
724241: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=724241
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: flightgear
Version: 2.10.0-4
Severity: normal

Currently, flightgear doesn't have an apport package hook, which may
prevent the package from getting stack traces of bugs and the options
the user had at the time of the crash (which may have had a hand in the
crash). I've attached a hook that gets the autosave information and the
preferences (if available) at the time of launching FlightGear.

-- 
Saikrishna Arcot

import os
from stat import *
from apport.hookutils import *
import subprocess

HOME    = os.getenv("HOME")
PACKAGE = 'flightgear'
RELATED_PACKAGES = [
        PACKAGE,
        'libsimgearcore2.10.0',
        'libsimgearscene2.10.0',
        'flightgear-data-ai',
        'flightgear-data-scenery',
        'flightgear-data-aircraft',
]

def installed_version(report, pkgs):
        report['RelatedPackagesPolicy'] = ''
        for pkg in pkgs:
                script = subprocess.Popen(['apt-cache', 'policy', pkg], 
stdout=subprocess.PIPE)
                report['RelatedPackagesPolicy'] += str(script.communicate()[0]) 
+ "\n"
        
def get_envs(envs):
        s = ""
        for env in envs:
                s += env + " = " + str(os.getenv(env)) + "\n"
        return s

def add_info(report, ui = None):
        attach_related_packages(report, RELATED_PACKAGES)
        installed_version(report, RELATED_PACKAGES)
        
        # Autosave and Preferences
        attach_file_if_exists(report, HOME + '/.fgfs/autosave.xml', 'Autosave')
        # 2.12 and beyond
        # version = report.get('Package', '').split()[1].split('.')
        # attach_file_if_exists(report, HOME + '/.fgfs/autosave_' + version[0] 
+ '_' + version[1] + '.xml', 'Autosave')
        attach_file_if_exists(report, HOME + '/.fgfs/preferences.xml', 
'Preferences')
        # attach_file_if_exists(report, HOME + '/.fgfs/fgfs.log', 
'FlightGearLog')

        # DE
        report['Desktop-Session'] = get_envs([ 'DESKTOP_SESSION', 
'XDG_CONFIG_DIRS', 'XDG_DATA_DIRS' ])

        # Env
        report['Env'] = get_envs([ 'LD_LIBRARY_PATH' ])

        # Disk usage
        script = subprocess.Popen([ 'df', '-Th' ], stdout=subprocess.PIPE)
        report['DiskUsage'] = str(script.communicate()[0]) + "\n\nInodes:\n"
        script = subprocess.Popen([ 'df', '-ih' ], stdout=subprocess.PIPE)
        report['DiskUsage'] += str(script.communicate()[0])

## DEBUGING ##
if __name__ == '__main__':
        report = {}
        add_info(report)
        for key in report:
                print('[%s]\n%s\n' % (key, report[key]))

--- End Message ---
--- Begin Message ---
Hi,

given Debian doesn't use apport, I think we don't need to add hooks for it.

Regards

Markus Wanner


Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to