From 5d6baedbc9adda7bffd6a1213aa3abb279ddea9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Mon, 17 Mar 2014 14:52:01 +0100 Subject: [PATCH] Try to fix
 issues on large lastbuilds

---
 fdroidserver/build.py  | 5 +----
 fdroidserver/common.py | 3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fdroidserver/build.py b/fdroidserver/build.py
index 92f3d00e..2155ec81 100644
--- a/fdroidserver/build.py
+++ b/fdroidserver/build.py
@@ -962,10 +962,7 @@ def main():
             if options.wiki and wikilog:
                 try:
                     newpage = site.Pages[app['id'] + '/lastbuild']
-                    txt = wikilog
-                    if len(txt) > 8192:
-                        txt = txt[-8192:]
-                    txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + txt
+                    txt = "Build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + "\n\n" + wikilog
                     newpage.save(txt, summary='Build log')
                 except:
                     logging.info("Error while attempting to publish build log")
diff --git a/fdroidserver/common.py b/fdroidserver/common.py
index 2cf1904e..75139b28 100644
--- a/fdroidserver/common.py
+++ b/fdroidserver/common.py
@@ -774,7 +774,8 @@ class BuildException(Exception):
         if self.detail:
             ret += "=detail=\n"
             ret += "
\n"
-            ret += str(self.detail)
+            txt = self.detail[-8192:] if len(self.detail) > 8192 else self.detail
+            ret += str(txt)
             ret += "
\n" return ret -- 2.30.2