]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
merged from the debian-sid branch
[apt.git] / apt-pkg / deb / dpkgpm.cc
index a54c203305bdec2c1708f81d420351ad1d5f4a3e..b41b38bd54ed7b9fca9b5df222347c5a89f1e8d5 100644 (file)
@@ -793,16 +793,14 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       sighandler_t old_SIGHUP = signal(SIGHUP,SIG_IGN);
 
       struct   termios tt;
-      struct   termios tt_out;
       struct   winsize win;
       int      master;
       int      slave;
 
       // FIXME: setup sensible signal handling (*ick*)
       tcgetattr(0, &tt);
-      tcgetattr(1, &tt_out);
       ioctl(0, TIOCGWINSZ, (char *)&win);
-      if (openpty(&master, &slave, NULL, &tt_out, &win) < 0) 
+      if (openpty(&master, &slave, NULL, &tt, &win) < 0) 
       {
         const char *s = _("Can not write log, openpty() "
                           "failed (/dev/pts not mounted?)\n");
@@ -1125,6 +1123,29 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
         fclose(log);
       }
    }
+
+   // log the ordering 
+   const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
+   fprintf(report, "AptOrdering:\n");
+   for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+      fprintf(report, " %s: %s\n", (*I).Pkg.Name(), ops_str[(*I).Op]);
+
+   // attach dmesg log (to learn about segfaults)
+   if (FileExists("/bin/dmesg"))
+   {
+      FILE *log = NULL;
+      char buf[1024];
+
+      fprintf(report, "Dmesg:\n");
+      log = popen("/bin/dmesg","r");
+      if(log != NULL)
+      {
+        while( fgets(buf, sizeof(buf), log) != NULL)
+           fprintf(report, " %s", buf);
+        fclose(log);
+      }
+   }
    fclose(report);
+
 }
                                                                        /*}}}*/