add some CVS information into crashlog
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 6 Apr 2006 09:26:53 +0000 (09:26 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 6 Apr 2006 09:26:53 +0000 (09:26 +0000)
main/Makefile.am
main/bsod.cpp

index 636c6ff..abc71cd 100644 (file)
@@ -6,6 +6,20 @@ bin_PROGRAMS = enigma2
 enigma2_SOURCES = \
        enigma.cpp bsod.cpp
 
+bsod.o: version.h
+
+# when there is no ../CVS/Entries, don't worry.
+../CVS/Entries:
+
+../CVS/Root:
+
+# this depends on Entries and not on Tag because Tag isn't always there.
+# Entries, however, will change then Tag is changed, so everything is fine.
+version.h: ../CVS/Entries ../CVS/Root
+       > version.h
+       if [ -f ../CVS/Tag ]; then echo "#define ENIGMA2_CHECKOUT_TAG \"`cat ../CVS/Tag`\"" >> version.h; fi
+       if [ -f ../CVS/Root ]; then echo "#define ENIGMA2_CHECKOUT_ROOT \"`cat ../CVS/Root`\"" >> version.h; fi
+
 enigma2_LDADD_WHOLE = \
        $(top_builddir)/lib/actions/libenigma_actions.a \
        $(top_builddir)/lib/base/libenigma_base.a \
index dd274ec..1002178 100644 (file)
@@ -7,6 +7,8 @@
 #include <lib/gdi/grc.h>
 #include <lib/gdi/gfbdc.h>
 
+#include "version.h"
+
 /************************************************/
 
 #define CRASH_EMAILADDR "crashlog@dream-multimedia-tv.de"
@@ -72,6 +74,14 @@ void bsodFatal()
        {
                time_t t = time(0);
                fprintf(f, "enigma2 crashed on %s", ctime(&t));
+#ifdef ENIGMA2_CHECKOUT_TAG
+               fprintf(f, "enigma2 CVS TAG: " ENIGMA2_CHECKOUT_TAG "\n");
+#else
+               fprintf(f, "enigma2 compiled on " __DATE__ "\n");
+#endif
+#ifdef ENIGMA2_CHECKOUT_ROOT
+               fprintf(f, "enigma2 checked out from " ENIGMA2_CHECKOUT_ROOT "\n");
+#endif
                fprintf(f, "please email this file to " CRASH_EMAILADDR "\n");
                std::string buffer = getLogBuffer();
                fwrite(buffer.c_str(), buffer.size(), 1, f);
@@ -83,6 +93,7 @@ void bsodFatal()
        
        {
                gPainter p(my_dc);
+               p.resetOffset();
                p.resetClip(eRect(ePoint(0, 0), my_dc->size()));
                p.setBackgroundColor(gRGB(0x0000C0));
                p.setForegroundColor(gRGB(0xFFFFFF));
@@ -120,6 +131,7 @@ void bsodFatal()
        
                p.renderText(usable_area, 
                        lines.substr(start), gPainter::RT_HALIGN_LEFT);
+               p.flush();
        }
 
        raise(SIGKILL);