root/mail-onna-stick/trunk/support/buildbot/buildslave/bot_scripts/build_egg.py

Revision 250, 1.0 kB (checked in by t, 11 years ago)

once more unto the breach: fix for different easy_install locations.

  • Property svn:executable set to *
Line 
1 #!/usr/bin/env python
2
3 import os, sys, re
4 from _util import run_cmd, rmdirs
5
6 MOS_HOME = os.environ.get('MOS_HOME', os.getcwd())
7
8 def build_egg():
9     return run_cmd("%s setup.py bdist_egg" % (sys.executable,))
10
11 def get_egg_filename(output):
12     egg_filename = ""
13     lines = output.split("\n")
14     for line in lines:
15         s = re.search("creating \'(dist\/MailOnnaStick-.*egg)\' and", line)
16         if s:
17             egg_filename = s.group(1)
18             break
19     return egg_filename
20
21 if __name__ == "__main__":
22     os.chdir(MOS_HOME)
23     rmdirs("build", "dist")
24     rc, output = build_egg()
25     print output
26     if rc:
27         sys.exit(rc)
28     egg_filename = get_egg_filename(output)
29     egg_path = os.path.join(MOS_HOME, egg_filename)
30     if os.path.isfile(egg_path):
31         print "buildbot: egg file %s found" % egg_path
32         print ''
33         print 'SUCCESS'
34         sys.exit(0)
35     else:
36         print "buildbot: egg file %s not found" % egg_path
37         print ''
38         print 'FAILURE'
39         sys.exit(1)
40
Note: See TracBrowser for help on using the browser.