~ubuntu-branches/ubuntu/natty/apport/natty-proposed

« back to all changes in this revision

Viewing changes to bin/apport-unpack

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2011-02-04 15:46:40 UTC
  • mfrom: (148.1.35)
  • Revision ID: package-import@ubuntu.com-20110204154640-g7qilc3jix7fv9nr
Tags: 1.17.2-0ubuntu1
* New upstream bug fix release:
  - Be more Python 3 compatible (not fully working with Python 3 yet,
    though).
  - apt/dpkg backend: Drop support for pre-0.7.9 python-apt API.
  - Add --tag option to add extra tags to reports. (LP: #572504)
  - hookutils.py, attach_dmesg(): Do not overwrite already existing dmesg.
  - hookutils.py: Be more robust against file permission errors.
    (LP: #444678)
  - ui.py: Do not show all the options in --help when invoked as *-bug.
    (LP: #665953)
  - launchpad.py: Adapt test cases to current standard_title() behaviour.
* debian/control: Bump python-apt dependency to >= 0.7.9 to ensure that we
  have the current API. Trunk dropped support for the old API.
* data/general-hooks/ubuntu.py: Ignore obsolete packages when filing bugs
  against update-manager. (LP: #397519)
* data/general-hooks/ubuntu.py: Do not file a package install failure if
  DpkgTerminalLog doesn't have any data. (LP: #695887)
* Add debian/apport.postinst: Create /var/crash. This directory is required
  for package failures even if apport is disabled and thus the upstart job
  does not run. (LP: #683367)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
try:
31
31
    if os.path.isdir(dir):
32
32
        if os.listdir(dir):
33
 
            print >> sys.stderr, _('Destination directory exists and is not empty.')
34
 
            sys.exit(1)
 
33
            apport.fatal(_('Destination directory exists and is not empty.'))
35
34
    else:
36
35
        os.mkdir(dir)
37
36
except OSError, e:
38
 
    print >> sys.stderr, e
39
 
    sys.exit(1)
 
37
    apport.fatal(str(e))
40
38
 
41
39
pr = problem_report.ProblemReport()
42
40
if report == '-':
45
43
    try:
46
44
        pr.load(open(report))
47
45
    except IOError, e:
48
 
        print >> sys.stderr, e
49
 
        sys.exit(1)
 
46
        apport.fatal(str(e))
50
47
for k in pr:
51
48
    open(os.path.join(dir, k), 'w').write(pr[k])