=== modified file 'DistUpgrade/DistUpgradeApport.py' --- DistUpgrade/DistUpgradeApport.py 2012-05-16 21:05:42 +0000 +++ DistUpgrade/DistUpgradeApport.py 2012-05-29 16:09:00 +0000 @@ -6,6 +6,28 @@  import gettext  import errno  +APPORT_WHITELIST = [ + "apt.log", + "apt-term.log", + "history.log", + "lspci.txt", + "main.log", + "term.log", + "screenlog.0", + "xorg_fixup.log", + ] + + +def _apport_append_logfiles(report, logdir="/var/log/dist-upgrade/"): + for fname in os.listdir(logdir): + if not fname in APPORT_WHITELIST: + continue + f = os.path.join(logdir, fname) + if not os.path.isfile(f) or os.path.getsize(f) == 0: + continue + report[f.replace(".","").replace("-","")] = (open(f), ) + +  def apport_crash(type, value, tb):  logging.debug("running apport_crash()")  try: @@ -22,11 +44,7 @@  report = Report()  report.setdefault('Tags', 'dist-upgrade')  report['Tags'] += ' dist-upgrade' - for fname in os.listdir("/var/log/dist-upgrade/"): - f = os.path.join("/var/log/dist-upgrade",fname) - if not os.path.isfile(f) or os.path.getsize(f) == 0: - continue - report[f.replace(".","").replace("-","")] = (open(f), ) + _apport_append_logfiles(report)  report.add_to_existing('/var/crash/_usr_bin_update-manager.0.crash')  return True  @@ -48,8 +66,9 @@  return False   if os.path.exists(s): + log_files = [LOGDIR + fname for fname in APPORT_WHITELIST]  try: - p = subprocess.Popen([s,"-p",pkg,"-l",LOGDIR], stdin=subprocess.PIPE) + p = subprocess.Popen([s,"-p",pkg,"-l",log_files], stdin=subprocess.PIPE)  p.stdin.write("ErrorMessage: %s\n" % errormsg)  p.stdin.close()  #p.wait()