From 6bd57d9eeaa7851d7503084661bfa64585c38420 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Fri, 3 May 2013 07:55:40 +0100 Subject: [PATCH 1/2] Send logs for failed vcs checkout, etc to wiki too --- fdroidserver/build.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 08de1f04..fd6c8c8d 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -631,6 +631,7 @@ def main(): tmp_dir, repo_dir, vcs, options.test, options.server, options.install, options.force, options.verbose): build_succeeded.append(app) + wikilog = "Build succeeded" except BuildException as be: logfile = open(os.path.join(log_dir, app['id'] + '.log'), 'a+') logfile.write(str(be)) @@ -639,25 +640,29 @@ def main(): sys.exit(1) print "Could not build app %s due to BuildException: %s" % (app['id'], be) failed_apps[app['id']] = be - if options.wiki: - newpage = site.Pages[app['id'] + '/lastbuild'] - txt = str(be) - if len(txt) > 8192: - txt = txt[-8192:] - try: - newpage.save(str(be), summary='Build log') - except: - print "Error while attempting to publish build log" + wikilog = str(be) except VCSException as vcse: if options.stop: sys.exit(1) print "VCS error while building app %s: %s" % (app['id'], vcse) failed_apps[app['id']] = vcse + wikilog = str(vcse) except Exception as e: if options.stop: sys.exit(1) print "Could not build app %s due to unknown error: %s" % (app['id'], traceback.format_exc()) failed_apps[app['id']] = e + wikilog = str(e) + + if options.wiki: + newpage = site.Pages[app['id'] + '/lastbuild'] + txt = wikilog + if len(txt) > 8192: + txt = txt[-8192:] + try: + newpage.save(str(be), summary='Build log') + except: + print "Error while attempting to publish build log" for app in build_succeeded: print "success: %s" % (app['id']) From 295784a249bf3b6f8d836c0b7eaa09ba01d263ed Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Fri, 3 May 2013 08:01:42 +0100 Subject: [PATCH 2/2] Reduce update verbosity a bit --- fdroidserver/update.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index d793a48c..750d8f18 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -165,7 +165,8 @@ def update_wiki(apps, apks, verbose=False): print "Updating modified page " + page.name page.save(generated_pages[page.name], summary='Auto-updated') else: - print "Page " + page.name + " is unchanged" + if verbose: + print "Page " + page.name + " is unchanged" else: print "Deleting page " + page.name page.delete('No longer published')