1 # Copyright (C) 2006, Thomas Leonard
2 # See http://0install.net/0compile.html
5 from os
.path
import join
7 from support
import BuildEnv
9 def do_report_bug(args
):
13 log_name
= 'build/build-failure.log'
14 build_log
= file(log_name
)
15 log_text
= build_log
.read()
18 build_env_xml_file
= join(buildenv
.metadir
, 'build-environment.xml')
19 if os
.path
.exists(build_env_xml_file
):
20 build_env_xml
= file(build_env_xml_file
)
21 log_text
+= '\n\nSelected versions:\n' + build_env_xml
.read()
24 log_text
+= '\n\n"%s" file not found' % build_env_xml_file
27 from urllib2
import urlopen
29 print "Sending contents of %s file to default bug tracker..." % log_name
31 stream
= urlopen('http://sourceforge.net/tracker/index.php',
37 'summary': log_text
.split('\n', 1)[0], # First line of log
38 'details': log_text
}))
42 __main__
.commands
.append(do_report_bug
)