File: install_egg

package info (click to toggle)
scitools 0.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,148 kB
  • ctags: 3,332
  • sloc: python: 34,714; sh: 112; makefile: 8
file content (28 lines) | stat: -rwxr-xr-x 797 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
"""
Install scitools using python eggs tagged with revision number:
 1) Remove previous eggs
 2) Build an easy_install egg tagged with svn revision number
 3) Install egg
"""
# Should we add eggs to PyPi?

import commands
import sys
import os

cmd = 'rm -f dist/*.egg &&'\
      'python setupegg.py  egg_info --tag-svn-revision  bdist_egg &&'\
      'easy_install --always-unzip --prefix=%(prefix)s '\
      'dist/SciTools*py%(pyversion)s.egg'  \
      %{'prefix': os.environ.get('PREFIX', sys.prefix),
        'pyversion': '.'.join(map(str, sys.version_info[:2]))
        }

for cmd_ in cmd.split('&&'):
    if 'y' in raw_input('Execute the following command? \n%s\n[y/N]' %cmd_):
        print ''
        print commands.getoutput(cmd_)
        print '\r'