~ubuntu-branches/ubuntu/maverick/dovecot/maverick-proposed

« back to all changes in this revision

Viewing changes to debian/source_dovecot.py

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-07-08 09:13:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100708091329-hwzqrdt4j368yqm0
Tags: 1:1.2.12-1ubuntu2
debian/rules, debian/source_dovecot.py: Add apport hook. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
'''Dovecot Apport interface
 
4
 
 
5
Copyright (C) 2010 Canonical Ltd/
 
6
Author: Chuck Short <chuck.short@canonical.com>
 
7
 
 
8
This program is free software; you can redistribute it and/or modify it
 
9
under the terms of the GNU General Public License as published by the
 
10
Free Software Foundation; either version 2 of the License, or (at your
 
11
option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
 
12
the full text of the license.
 
13
'''
 
14
 
 
15
from apport.hookutils import *
 
16
 
 
17
def add_info(report, ui):
 
18
        response = ui.yesno("The output of dovecot -n may help developers diagnose your bug more quickly, however, it may contain sensitive information. Do you want to include it in your bug report?")
 
19
 
 
20
        if response == None: #user canceled
 
21
                raise StopIteration
 
22
 
 
23
        elif response == True:
 
24
                report['DovecotConf'] = root_command_output(['/usr/sbin/dovecot', '-n'])
 
25
                
 
26
 
 
27
        elif response == False:
 
28
                ui.information("The contents of dovecot -n will NOT be includeded in the bug report")
 
29
 
 
30
        packages=['dovecot-common', 'dovecot-dev', 'dovecot-pop3d', 'dovecot-imapd',  'mail-stack-delivery', 'dovecot-postfix']
 
31
        versions = ''
 
32
        for package in packages:
 
33
                try:
 
34
                        version  = package.get_version(package)
 
35
                except:
 
36
                        version = 'N/A'
 
37
                versions += '%s %s\n' %(package, version)
 
38
        report['DovecotInstalledVersions'] = versions   
 
39