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

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

major path hacking.

  • Property svn:executable set to *
Line 
1 #!/usr/bin/env python
2
3 import os, sys, glob
4 from _util import run_cmd, rmdirs, SCRIPT_DIR
5 import pkg_resources
6
7 MOS_HOME = os.environ.get('MOS_HOME', os.getcwd())
8 EGG_TARGET_DIR = os.path.join(MOS_HOME, "dist-install")
9
10 def install_egg(egg_filename):
11     return run_cmd("%s %s/easy_install.py -d %s %s" % (sys.executable, SCRIPT_DIR, EGG_TARGET_DIR, egg_filename))
12
13 if __name__ == "__main__":
14     os.chdir(MOS_HOME)
15     rmdirs(EGG_TARGET_DIR)
16     os.mkdir(EGG_TARGET_DIR)
17
18     os.environ['PYTHONPATH'] = EGG_TARGET_DIR
19     sys.path.insert(0, EGG_TARGET_DIR)
20
21     egg_filelist = glob.glob(os.path.join(MOS_HOME, "dist", "MailOnnaStick*egg"))
22     if not len(egg_filelist):
23         print "buildbot: no eggs found"
24         sys.exit(1)
25     if len(egg_filelist) > 1:
26         print "buildbot: more than 1 egg found:"
27         print "\n".join(egg_filelist)
28         sys.exit(1)
29     egg_filename = egg_filelist[0]
30     rc, output = install_egg(egg_filename)
31     print output
32
33     sys.exit(rc)
Note: See TracBrowser for help on using the browser.